Displaying 1-10 of 211 results found.
page
1
2
3
4
5
6
7
8
9
10
... 22
1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 113, 121, 125, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 311
COMMENTS
In contrast to A195942, we also allow for primes (p^n with n=1) in this sequence.
PROG
(PARI) for( n=1, 9999, is_ A000961(n) && is_ A052382(n) && print1(n", "))
(Haskell)
a195943 n = a195943_list !! (n-1)
a195943_list = filter ((== 1) . a010055) a052382_list
CROSSREFS
Cf. A195942, A195944, A195945, A195946, A195908, A195948, A007377, A008839, A030700, A030701, A030702, A030703, A030704, A030705, A030706.
Zeroless prime powers (excluding primes): Intersection of A025475 and A052382.
+20
21
1, 4, 8, 9, 16, 25, 27, 32, 49, 64, 81, 121, 125, 128, 169, 243, 256, 289, 343, 361, 512, 529, 625, 729, 841, 961, 1331, 1369, 1681, 1849, 2187, 2197, 3125, 3481, 3721, 4489, 4913, 5329, 6241, 6561, 6859, 6889, 7921, 8192
MATHEMATICA
mx = 10^10; t = {1}; p = 2; While[pw = 2; While[n = p^pw; n <= mx, If[Union[IntegerDigits[n]][[1]] > 0, AppendTo[t, n]]; pw++]; pw > 2, p = NextPrime[p]]; t = Sort[t] (* T. D. Noe, Sep 27 2011 *)
PROG
(PARI) for( n=1, 9999, is_ A025475(n) && is_ A052382(n) && print1(n", "))
(Haskell)
a195942 n = a195942_list !! (n-1)
a195942_list = filter (\x -> a010051 x == 0 && a010055 x == 1) a052382_list
CROSSREFS
Cf. A195985, A195943, A195944, A195945, A195946, A195908, A195948, A007377, A008839, A030700, A030701, A030702, A030703, A030704, A030705, A030706.
Decimal encoding of the prime factorization of n: for n > 0 with prime factorization Product_{i=1..k} prime(i)^e_i, let E_n = (e_k, ..., e_1), replace each nonzero e_i with A052382(e_i) and each zero e_i with "" in E_n to obtain F_n, concatenate the elements of F_n with a "0" inserted after every element except for the last, and interpret in decimal base.
+20
4
0, 1, 10, 2, 100, 101, 1000, 3, 20, 1001, 10000, 102, 100000, 10001, 1010, 4, 1000000, 201, 10000000, 1002, 10010, 100001, 100000000, 103, 200, 1000001, 30, 10002, 1000000000, 10101, 10000000000, 5, 100010, 10000001, 10100, 202, 100000000000, 100000001
COMMENTS
This sequence is an analog of A156552 for the decimal base.
This sequence establishes a bijection between the positive numbers and the nonnegative numbers; see A290389 for the inverse sequence.
The number of runs of consecutive nonzero digits in the decimal representation of a(n) corresponds to the number of distinct prime factors of n.
a( A003961(n)) = 10 * a(n) for any n > 0.
a(n) = 0 mod 10 iff n is odd.
a(prime(n)^k) = A052382(k) * 10^(n-1) for any n > 0 and k > 0 (where prime(n) is the n-th prime).
a(prime(n)#) = Sum_{k=1..n} 100^(k-1) for any n > 0 (where prime#(n) = A002110(n)).
EXAMPLE
For n = 5120 = 5^1 * 3^0 * 2^10:
- E_5120 = (1, 0, 10),
- F_5120 = ("1", "", "11"),
- a(5120) = 10011.
For n = 5040 = 7^1 * 5^1 * 3^2 * 2^4:
- E_5040 = (1, 1, 2, 4),
- F_5040 = ("1", "1", "2", "4"),
- a(5040) = 1010204.
MATHEMATICA
f[n_] := Function[m, Sum[(1 + Mod[Floor[(8 n + 1 - 9^m)/(8*9^j)], 9]) 10^j, {j, 0, m - 1}]]@ Floor@ Log[9, 8 n + 1]; Table[If[n == 1, 0, With[{s = FactorInteger[n] /. {p_, e_} /; p > 0 :> If[p > 1, PrimePi@ p -> f@ e]}, Function[t, FromDigits@ Flatten@ Reverse@ Riffle[#, ConstantArray[0, Length@ #]] &[ReplacePart[t, s] /. 0 -> {}]]@ConstantArray[0, Max[s[[All, 1]] ]]]], {n, 38}] (* Michael De Vlieger, Jul 31 2017 *)
PROG
(PARI) a(n) = {
my (f = factor(n), v = 0, nz = 0);
for (i=1, #f~,
v += x * 10^(nz + prime pi(f[i, 1]) - 1);
nz += #digits(x);
);
return (v)
}
Let x run through the list of numbers with no zeros ( A052382); replace each digit d of x by the digit (x mod d).
+20
4
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 4, 3, 2, 1, 10, 0, 12, 0, 10, 2, 16, 4, 12, 10, 20, 0, 12, 20, 0, 12, 26, 3, 10, 20, 31, 0, 10, 24, 35, 0, 14, 10, 20, 32, 42, 0, 12, 21, 32, 45, 10, 20, 30, 40, 50, 0, 14, 24, 36, 10, 20, 31, 42, 50, 64, 0, 16, 27, 10
COMMENTS
Graph of the sequence generates a fractal-like image.
EXAMPLE
If x = 247 we get 132 as 247 mod 2 = 1, 247 mod 4 = 3, and 247 mod 7 = 2. As 247 is the 205th zeroless number, a(205) = 132.
MATHEMATICA
f[n_] := FromDigits @ Mod[n, IntegerDigits[n]]; f /@ Select[Range[100], !MemberQ[IntegerDigits[#], 0] &] (* Amiram Eldar, Jul 26 2021 *)
PROG
(C)
#include <stdio.h>
#define START 1
#define END 1000
int main(){
unsigned int R, N, M, power_cntr;
int mod1, mod2;
for(N=START; N<=END; N++){
R=N;
M=0;
power_cntr=1;
while(R!=0){
mod1=R%10;
if(mod1==0) break;
mod2=N%mod1;
M+=mod2*power_cntr;
power_cntr*=10;
R=R/10; }
if(mod1!=0) printf("%u %u\n", N, M); }
return 0; }
(PARI) a(m) = my(d=digits(m)); fromdigits(Vec(apply(x->(m % x), d)));
apply(x->a(x), select(x->vecmin(digits(x)), [1..100])) \\ Michel Marcus, Jul 24 2021
(Python)
def f(k, digits): return int("".join(map(str, map(lambda x: k%x, digits))))
def aupton(terms):
alst, k = [], 1
while len(alst) < terms:
s = str(k)
if '0' not in s: alst.append(f(k, list(map(int, s))))
k += 1
return alst
Zeroless numbers k (numbers in A052382) such that k - DigitProduct(k) contains the same distinct digits as k.
+20
1
293, 362, 436, 545, 554, 631, 653, 749, 763, 891, 958, 965, 1293, 1362, 1436, 1545, 1554, 1631, 1653, 1749, 1763, 1891, 1958, 1965, 2193, 2331, 2491, 2536, 2556, 2565, 2693, 2917, 2954, 2963, 3162, 3231, 3325, 3382, 3529, 3534, 3635, 3651, 4291, 4515, 4533, 4551, 4634, 4935, 4952, 4971
COMMENTS
Numbers that contain zeros trivially have this property. - Tanya Khovanova, Jul 19 2021
EXAMPLE
631 - 6*3*1 = 613 contains the same digits as 631. So 631 is a term of this sequence.
MATHEMATICA
Select[Range@5000, (d=IntegerDigits@#; FreeQ[d, 0]&&Union@IntegerDigits[#-Times@@d]==Union@d)&] (* Giorgos Kalogeropoulos, Jul 20 2021 *)
PROG
(PARI)
for(n=1, 10^4, d=digits(n); p=prod(i=1, #d, d[i]); if(p && vecsort(digits(n), , 8)==vecsort(digits(n-p), , 8), print1(n, ", ")))
(Python)
from math import prod
def ok(n):
s = str(n)
return '0' not in s and set(str(n-prod(int(d) for d in s))) == set(s)
CROSSREFS
Cf. A247888 (similar, with n + digit product).
T(n,k) is the k-th partition of n in graded reverse lexicographic ordering ( A080577) encoded as concatenation of parts which are represented in (zeroless) bijective base-9 numeration ( A052382) and separated by zeros; triangle T(n,k), n >= 0, 1 <= k <= A000041(n), read by rows.
+20
1
0, 1, 2, 101, 3, 201, 10101, 4, 301, 202, 20101, 1010101, 5, 401, 302, 30101, 20201, 2010101, 101010101, 6, 501, 402, 40101, 303, 30201, 3010101, 20202, 2020101, 201010101, 10101010101, 7, 601, 502, 50101, 403, 40201, 4010101, 30301, 30202, 3020101, 301010101
COMMENTS
The encoding used here allows a lossless and human-readable compression of all partitions. To decode a term replace the zeros with commas and read the parts in bijective base 9.
The empty partition is encoded as 0.
EXAMPLE
T(6,6) = 30201 encodes the 6th partition of 6: [3,2,1].
T(10,1) = 11 encodes the 1st partition of 10: [10].
T(23,23) = 18040101 encodes the 23rd partition of 23: [17,4,1,1].
Triangle T(n,k) begins:
0;
1;
2, 101;
3, 201, 10101;
4, 301, 202, 20101, 1010101;
5, 401, 302, 30101, 20201, 2010101, 101010101;
6, 501, 402, 40101, 303, 30201, 3010101, 20202, 2020101, ...
7, 601, 502, 50101, 403, 40201, 4010101, 30301, 30202, ...
8, 701, 602, 60101, 503, 50201, 5010101, 404, 40301, 40202, ...
9, 801, 702, 70101, 603, 60201, 6010101, 504, 50301, 50202, ...
11, 901, 802, 80101, 703, 70201, 7010101, 604, 60301, 60202, ...
...
MAPLE
g:= proc(n) option remember; local d, m, l; m, l:= n, "";
while m>0 do d:= irem(m, 9, 'm');
if d=0 then d:=9; m:= m-1 fi; l:= d, l
od; parse(cat(l))
end:
b:= (n, i)-> `if`(n=0, [""], `if`(i<1, [], [map(x-> cat(
0, g(i), x), b(n-i, min(n-i, i)))[], b(n, i-1)[]])):
T:= n-> map(x-> parse(cat(0, x)), b(n$2))[]:
seq(T(n), n=0..10);
CROSSREFS
Column k=1 gives A052382 (for n>0).
Last row elements give A094028(n-1) (for n>0).
Numbers in base 9.
(Formerly M0490)
+10
308
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84
COMMENTS
Also numbers without 9 as a digit.
REFERENCES
Julian Havil, Gamma, Exploring Euler's Constant, Princeton University Press, Princeton and Oxford, 2003, page 34.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
FORMULA
a(0) = 0, a(n) = 10*a(n/9) if n==0 (mod 9), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
MAPLE
A007095 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n, base, 9): return op(convert(l, base, 10, 10^nops(l))): end: seq( A007095(n), n=0..67); # Nathaniel Johnston, May 06 2011
MATHEMATICA
Table[ FromDigits[ IntegerDigits[n, 9]], {n, 0, 75}]
PROG
(PARI) a(n)=if(n<1, 0, if(n%9, a(n-1)+1, 10*a(n/9)))
(Magma) [ n: n in [0..74] | not 9 in Intseq(n) ]; // Bruno Berselli, May 28 2011
(sh) seq 0 1000 | grep -v 9; # Joerg Arndt, May 29 2011
(Haskell)
a007095 = f . subtract 1 where
f 0 = 0
f v = 10 * f w + r where (w, r) = divMod v 9
(Python) # and others: see OEIS Wiki page (cf. LINKS).
Numbers that contain a digit 0.
+10
115
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 301, 302
COMMENTS
Zerofree floor: The greatest zerofree number < a(n) is A052382(a(n) + 1 - n).
The greatest zero-containing number (i.e., non-zerofree number, or term of this sequence) less than a given zerofree number A052382(n) is a( A052382(n) + 1 - n).
The ratio n/(a(n) + 1) indicates the relative proportion of zero-containing numbers less than or equal to a(n) compared to all numbers less than or equal to a(n). Since Lim_{n -> infinity} a(n)/n = 1, this can be expressed as "Almost all numbers contain a 0" (in a slightly informal manner).
As an example, for n = 10^100, n/(a(n) + 1) = 0.9999701184..., i.e., 99.997...% of all numbers between 0 and 10^100 contain a zero digit. Only the tiny proportion of 0.0000298816... (less than 0.003%) contain no zero digit. This is in contrast to the behavior for small indices, where the relative portion of numbers that contain no zero digit is significant: for n = 10^3 and even n = 10^7, the proportion of numbers less than or equal to n that contain no zero digit exceeds 81% and 53%, respectively.
Inversion: Given a number z that contains a zero digit, the index n for which a(n) = z is n = (z+1)*probability that a randomly chosen number k from the range 0..z contains a zero digit.
Example 1: z = 10; the probability that a randomly chosen number less than or equal to 10 contains no zero digit is 9/11. The probability that it contains a zero digit is p = 2/11. Thus, n = (z+1)*p = 2 and a(2) = 10.
Example 2: z = 10^6; the probability that a randomly chosen number with m > 1 digits contains no zero digit is (9/10)^(m-1). For m = 1 the probability is 9/10. The probability that a randomly chosen number with 1..m digits contains no zero digit is q = (9/10)*10/(10^m+1) + Sum_{i = 2..m} (9/10)^(i-1)*(10^i - 10^(i-1))/(10^m+1) = (72 + 81*(9^(m-1) - 1)/(8*(10^m+1)). Hence, the probability that the chosen number with 1..m digits contains a zero digit is p = 1 - q = (8*10^m - 9*9^m + 17)/(8*(10^m + 1)). Thus, p = 402131/1000001 (for z = 10^6) and so n = (z+1)*p = 402131, which implies a(402131) = 10^6.
The number of terms z such that k*10^m <= z < (k+1)*10^m is 10^m - 9^m, where 1 <= k < 10 and m >= 0.
The number of terms z such that 10^m <= z < 10^(m+1) is 9*(10^m - 9^m), where m >= 0.
The number of terms z <= 10^m is (8*10^m - 9*9^m + 17)/8 where m>=1 (cf. A217094).
Infinitely many terms are primes, and most primes are zero-containing numbers. Sketch of a proof: The number of zero-containing numbers less than or equal to a(n) is n. Hence there are a(n) + 1 - n zerofree numbers less than or equal to a(n). From the asymptotic behavior of a(n) (see formula section) it follows a(n) + 1 - n < (5/4)*n^log_10(9) for sufficiently large n. By the prime number theorem we have for each fixed d > 0 the relation pi(n) [number of primes less than or equal to n] > (1 - d/4)*(n/log(n)) for sufficiently large n. Thus, for the number of primes less than or equal to a(n) which contain a zero digit [hereafter denoted as P_0(a(n))] we have P_0(a(n)) > pi(a(n)) - (a(n) + 1 - n) > (1 - d/4)*a(n)/log(a(n)) - (5/4)*n^log_10(9) > (1-d/4)*n/log(n) - (5/4)*n^log_10(9) = (1-d/4)*n/log(n) * (1 - (5/4)*(1/(1-d/4))*(1/n) * n^(log_10(9))*log(n)) > (1-d/2)*n/log(n) for sufficiently large n. Because of a(n) = n + o(n) this also implies P_0(a(n)) > (1 - d)*a(n)/log(a(n)) for sufficiently large n. Thus, the proportion of primes less than or equal to a(n) which contain a zero digit compared to the total number of primes less than or equal to a(n) is arbitrarily near to 1 for sufficiently large n.
Sequence inversion:
Given a term m > 0, the index n such that a(n) = m can be calculated with the following procedure: Define k := floor(log_10(m)) and i := digit position of the leftmost '0' in m counted from the right (starting with 0), then:
A011540_inverse(m) = 2 + m mod 10^i + Sum_{j = 1..k} floor((m - 1 - m mod 10^i)/10^j)*9^(j-1) [see PROG section for an implementation in Smalltalk].
Example: m = 905, k = 2, i = 1, A011540_inverse(905) = 2 + 905 mod 10 + floor((905 - 1 - 905 mod 10)/10)*1 + floor((905 - 1 - 905 mod 10)/100)*9 = 2 + 5 + floor(899/10)*1 + floor(899/100)*9 = 2 + 5 + 89*1 + 8*9 = 168.
(End)
The above "sketch of proof" only compares the relative densities, and since the density of this sequence is 1, the result is "obvious". But the nontrivial part is that there is no correlation between the absence of a digit '0' and primality of the number (cf. A038618). Indeed, consider the set S defined to be the set of primes with all digits '0' replaced by the smallest possible nonzero digit while avoiding duplicates. Having exactly the same density as the set of primes, the argument of the proof applies in the same way and leads to the same conclusion for the number of zero-containing terms; however, there is none in the set S. - M. F. Hasler, Oct 11 2015, example added Feb 11 2019
FORMULA
Inequalities:
a(n) <= 10*(n - 1), equality holds for 1 <= n <= 11.
a(n) <= 9*n, for n <> 11.
a(n) < n + 10 * n^log_10(9).
a(n) < n + 2 * n^log_10(9), for n > 6*10^8.
a(n) > n + 9^log_10(9)/8 * n^log_10(9).
Iterative calculation:
a(n+1) = a(n) + 1 + 9*sign( A007954(a(n)+1)).
Recursive calculation (for n > 1):
Set m := floor(log_10(n)) + 1), j := floor(sign(n+1 - (8*10^m - 9*9^m + 17)/8) + 1)/2) + m - 1, d := 10^j - 9^j, b := (8*10^j - 9*9^j + 17)/8, and determine r(n) as follows:
Case 1: r(n) = a(b - d + (n - b) mod d), if (n - b) mod d > 10^(j-1) and n >= 19
Case 2: r(n) = (n - b) mod d, if (n - b) mod d <= 10^(j-1).
Then a(n) = (floor((n - b)/d) + 1)*10^j + r(n).
Direct calculation (for n>1):
Set m := floor(log_10(n)) + 1), j := floor((sign(n+1 - (8*10^m - 9*9^m + 17)/8) + 1)/2) + m - 1, and determine k and c(i) as follows:
c(1) = n - (8*10^j - 9*9^j + 17)/8, then define successively for i = 1, 2, ...,
c(i+1) = (c(i) mod (10^(j-i+1) - 9^(j-i+1))) - 10^(j-i) while this value is > 0, and set k := i for the last such index for which c(i) > 0 (in any case k is k<=j).
Then a(n) = c(k) mod (10^(j-k+1) - 9^(j-k+1)) + sum_{i=1..k}(floor(c(i)/(10^(j-i+1) - 9^(j-i+1))) + 1)*10^(j-i+1).
Asymptotic behavior:
a(n) = n + O(n^log_10(9)) = n*(1+ O(1/n^0.04575749056...)).
lim a(n)/n = 1 for n -> infinity.
lim inf (a(n) - n)/n^log_10(9) = 9^log_10(9)/8 = 1.017393081085670008926619124438...
lim sup (a(n) - n)/n^log_10(9) = 9/8 = 1.125.
Sums:
Sum_{n >= 2} (-1)^n/a(n) = 0.0693489578....
Sum_{n >= 2} 1/a(n)^2 = 0.0179656962...
Sum_{n >= 2} 1/a(n) diverges, because of a(n) < 10*n.
Sum_{n >= 1} a(n)/n^2 diverges too.
Sum_{n >= 2} 1/a(n)^2 + Sum_{n >= 1} 1/ A052382(n)^2 = Pi^2/6.
Generating function:
g(x) = Sum_{k >= 1} g_k(x), where the terms g_k(x) obey the following recurrence relation:
g_k(x) = 10^k*x^b(k) * (1 - 10x^(9d(k)) + 9x^(10d(k)))/((1-x^d(k))(1-x)) + (x*x^b(k) * (1 - 10^(k-1)*x^(10^(k-1)-1) + (10^(k-1)-1)*x^10^(k-1))/((1-x)^2) + g_(k-1)(x)*x^d(k)) * (1-x^(9d(k)))/(1-x^d(k)),
where b(k) := 2 + 10^k - 9^k - (9^k-1)/8,
d(k) := 10^k - 9^k, and g_0(x) = 0.
Explicit representation of g_k(x):
g_k(x) = (10^k*x^b(k)*(1 - 10x^(9d(k)) + 9x^(10d(k)))/(1-x^d(k)) + sum_{j=1..k-1} ((10^j*x^b(j) * (1 - 10x^(9d(j)) + 9x^(10d(j)))/(1-x^d(j)) + x^(b(j)-10^j+1) * (1 - 10^j*x^(10^j-1) + (10^j-1)*x^10^j)/(1-x)) * Product_{i=j+1..k} x^d(i)*(1-x^(9d(i)))/(1-x^d(i)))/(1-x).
A summation term g_k(x) of the g.f. represents all the sequence terms >= 10^k and < 10^(k+1).
Example 1: g_1(x) = 10*x^2*(1 - 10x^9 + 9x^10)/(1-x)^2 represents the g.f. fragment 10x^2 + 20x^3 + ... + 90x^10 and so generates the terms a(2)=10 ... a(10)=90.
Example 2: g_2(x) = 10^2*x^11*(1 - 10x^(9*19) + 9x^(10*19))/((1-x)(1-x^19)) + 10*x^21 * (1 - 10x^9 + 9x^10)/((1-x)^2) * (1-x^(9*19))/(1-x^19)) + x^11*x * (1 - 10x^9 + 9x^10)/((1-x)^2) * (1-x^(9*19))/(1-x^19) represents the g.f. fragment 100x^11 + 101x^12 + ... + 109x^20 + 110x^21 + 120x^22 + ... + 190x^29 + 200x^30 + 201x^31 + ... + 210x^40 + ... + 990x^181 and so generates the terms a(11) = 100 ... a(181) = 990.
(End)
The number C(n) of zero-containing numbers <= n (counting function) is given by C(n) = A011540_inverse(n), if n is a zero-containing number, and C(n) = A011540_inverse( A052382(a(n) + 1 - n)), if n is a zerofree number.
Upper bound:
C(n) <= n+1-((9*n+1)^d-1)/8.
Lower bound:
C(n) > n+1-((10*n+1)^d-1)/8
where d = log_10(9) = 0.95424250943932...
(End)
EXAMPLE
a(10) = 90.
a(100) = 540.
a(10^3) = 4005.
a(10^4) = 30501.
a(10^5) = 253503.
a(10^6) = 2165031.
a(10^7) = 20163807
a(10^8) = 182915091.
a(10^9) = 1688534028.
a(10^10) = 15749319096.
a(10^20) = 114131439770460123393.
a(10^50) = 10057979971082351274741...89870962249 = 1.0057979971082...*10^50
a(10^100) = 10000298815737485...786424499 = 1.0000298815737...*10^100.
a(10^1000) = 1...(45 zeros)...196635515818798306...4244999 (1001 digits), using recursive calculation. - Hieronymus Fischer, Jan 13 2013
MATHEMATICA
Select[Range[0, 299], DigitCount[#, 10, 0] > 0 &] (* Alonso del Arte, Mar 10 2011 *)
Select[Range[0, 299], Times@@IntegerDigits[#] == 0 &] (* Alonso del Arte, Aug 29 2014 *)
PROG
(Haskell)
a011540 n = a011540_list !! (n-1)
a011540_list = filter ((== 0) . a168046) [0..]
(PARI) A011540(n)=my(m=log(n+.5)\log(10)+1, f(m)=n-10^m+(9*9^m-17)/8, j=(sign(f(m)+1)+1)\2+m-1, c=[f(j)], k=1); while(c[k]>0, c=concat(c, c[k] % (10^(j-k+1) - 9^(j-k+1)) - 10^(j-k)); k++); k>1&&k--||n>1||return(0); c[k]%(10^(j-k+1) - 9^(j-k+1)) + sum(i=1, k, (c[i]\(10^(j-i+1) - 9^(j-i+1)) + 1)*10^(j-i+1)) \\ Uses the "Direct calculation" formula given by H. Fischer. - M. F. Hasler, Oct 11 2015
(Smalltalk)
"Calculates the n-th number with zero digits recursively - not optimized"
| n j m b d p r |
n := self.
n < 2 ifTrue: [^r := 0].
m := (n integerFloorLog: 10) + 1.
j := (n + 1 - ((10 raisedToInteger: m) - (((9 raisedToInteger: (m + 1)) - 17) // 8))) sign + 1 // 2 + m - 1.
d := (10 raisedToInteger: j) - (9 raisedToInteger: j).
b := ((10 raisedToInteger: j) - (((9 raisedToInteger: (j + 1)) - 17) // 8)).
(((n - b) \\ d > (10 raisedToInteger: (j - 1))) and: [n >= 19])
ifTrue:
[p := (((n - b) \\ d + b - d) A011540)].
(n - b) \\ d > (10 raisedToInteger: (j - 1))
ifFalse: [p := (n - b) \\ d].
r := (((n - b) // d + 1) * (10 raisedToInteger: j)) + p.
(Smalltalk)
"Version 1: Answers the index n such that A011540(n) = m, where m is the receiver.
Answer: n"
| m p q s r d |
m := self.
m < 10 ifTrue: [^1].
p := q := 1.
[p < m] whileTrue:
[d := m // p \\ 10.
d = 0 ifTrue: [q := p].
p := 10 * p].
r := m \\ q.
s := r + 2.
p := 10.
q := 1.
m := m - r - 1.
[p < m] whileTrue:
[s := m // p * q + s.
p := 10 * p.
q := 9 * q].
^s
(Smalltalk)
"Version 2: Answers the index n such that A011540(n) = m, where m is the receiver.
Answer: n"
| m p q d |
m := self.
m < 10 ifTrue: [^1].
p := q := 1.
[p < m] whileTrue:
[d := m // p \\ 10.
d = 0 ifTrue: [q := p].
p := 10 * p].
^m + 1 - (m - 1 - (m \\ q)) A052382_inverse
(Magma) [0] cat [ n: n in [0..350] | 0 in Intseq(n) ]; // Vincenzo Librandi, Oct 12 2015
(Python)
Powers of 9: a(n) = 9^n.
(Formerly M4653 N1992)
+10
109
1, 9, 81, 729, 6561, 59049, 531441, 4782969, 43046721, 387420489, 3486784401, 31381059609, 282429536481, 2541865828329, 22876792454961, 205891132094649, 1853020188851841, 16677181699666569, 150094635296999121, 1350851717672992089, 12157665459056928801
COMMENTS
Same as Pisot sequences E(1, 9), L(1, 9), P(1, 9), T(1, 9). Essentially same as Pisot sequences E(9, 81), L(9, 81), P(9, 81), T(9, 81). See A008776 for definitions of Pisot sequences.
Except for 1, the largest n-th power with n digits. - Amarnath Murthy, Feb 09 2002
The 2002 comment by Amarnath Murthy should say more precisely "n-th power with *at most* n digits": a(22) has only 21 digits etc., a(44) has only 42 digits etc. - Hagen von Eitzen, May 17 2009
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=1, a(n) equals the number of 9-colored compositions of n such that no adjacent parts have the same color. - Milan Janjic, Nov 17 2011
To be still more precise than Murthy and von Eitzen: the subsequence of the largest n-th power with n digits is a finite sequence, bounded by 9 and 109418989131512359209. It is guaranteed that 10^n has n + 1 digits in base 10, and clearly 9^n < 10^n. With a(22), the number n - log_10 a(n) crosses the 1.0 threshold, and obviously the gulf widens further after that, meaning that for n > 21, m^n can have fewer than n digits or more than n digits but not exactly n digits. - Alonso del Arte, Dec 12 2012
Erasing the last digit of the sum a(n) + a(n+1) brings back a(n). - Eric Angelini, Feb 05 2024
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
David Wells, The Penguin Dictionary of Curious and Interesting Integers. London: Penguin Books (1997): p. 196, entry for 109,418,989,131,512,359,209.
FORMULA
a(n) = 9^n.
a(0) = 1, a(n) = 9*a(n - 1) for n > 0.
G.f.: 1/(1 - 9*x).
E.g.f.: exp(9*x).
a(n) = det(|v(i+2,j)|, 1 <= i,j <= n), where v(n,k) are central factorial numbers of the first kind with odd indices. - Mircea Merca, Apr 04 2013
PROG
(Haskell)
a001019 = (9 ^)
a001019_list = iterate (* 9) 1
Numbers whose digits are primes.
+10
103
2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532
COMMENTS
If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - Hieronymus Fischer, May 30 2012
According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - M. F. Hasler, Sep 16 2016
FORMULA
a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
Special values:
a(1*(4^n-1)/3) = 2*(10^n-1)/9.
a(2*(4^n-1)/3) = 1*(10^n-1)/3.
a(3*(4^n-1)/3) = 5*(10^n-1)/9.
a(4*(4^n-1)/3) = 7*(10^n-1)/9.
Inequalities:
a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.
a(n) <= 2* A084544(n), equality holds iff all digits of A084544(n) are 1.
Lower and upper limits:
lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.
lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.
where 10^log_4(n) = n^1.66096404744...
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.
Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.
Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)
Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024
EXAMPLE
a(100) = 2277,
a(10^3) = 55327,
a(9881) = 3233232,
a(10^4) = 3235757,
a(10922) = 3333333,
a(10^5) = 227233257.
MATHEMATICA
Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* Michael De Vlieger, Sep 19 2016 *)
PROG
(Haskell)
a046034 n = a046034_list !! (n-1)
a046034_list = filter (all (`elem` "2357") . show ) [0..]
(Magma) [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]]; // Bruno Berselli, Jul 19 2011
(Python)
m = (3*n+1).bit_length()-1>>1
return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # Chai Wah Wu, Feb 08 2023
CROSSREFS
Cf. A046035, A118950, A019546 (primes), A203263, A035232, A039996, A085823, A052382, A084544, A084984, A017042, A001743, A001744, A014261, A014263, A153025, A191486, A193238, A202267, A202268, A211681, A365471 (complement).
Search completed in 0.105 seconds
|