cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 51-60 of 224 results. Next

A052404 Numbers without 2 as a digit.

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 89
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

References

  • M. J. Halm, Word Weirdness, Mpossibilities 66 (Feb. 1998), p. 5.

Crossrefs

Cf. A004177, A004721, A072809, A082831 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).
See A038604 for the subset of primes. - M. F. Hasler, Jan 11 2020

Programs

  • Haskell
    a052404 = f . subtract 1 where
       f 0 = 0
       f v = 10 * f w + if r > 1 then r + 1 else r  where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 2 in Intseq(n) ];  // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local l, m; l, m:= 0, n-1;
          while m>0 do l:= (d->
            `if`(d<2, d, d+1))(irem(m, 9, 'm')), l
          od; parse(cat(l))/10
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 01 2016
  • Mathematica
    ban2Q[n_]:=FreeQ[IntegerDigits[n],2]==True; Select[Range[0,89],ban2Q[#] &] (* Jayanta Basu, May 17 2013 *)
    Select[Range[0,100],DigitCount[#,10,2]==0&] (* Harvey P. Dale, Apr 13 2015 *)
  • PARI
    lista(nn, d=2) = {for (n=0, nn, if (!vecsearch(vecsort(digits(n),,8),d), print1(n, ", ")););} \\ Michel Marcus, Feb 21 2015
    
  • PARI
    apply( {A052404(n)=fromdigits(apply(d->d+(d>1),digits(n-1,9)))}, [1..99])
    next_A052404(n, d=digits(n+=1))={for(i=1, #d, d[i]==2&&return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n: if there's a digit 2 in n+1, replace the first occurrence by 3 and all following digits by 0.
    (A052404_vec(N)=vector(N, i, N=if(i>1, next_A052404(N))))(99) \\ first N terms
    select( {is_A052404(n)=!setsearch(Set(digits(n)),2)}, [0..99])
    (A052404_upto(N)=select( is_A052404, [0..N]))(99) \\ M. F. Hasler, Jan 11 2020
    
  • Python
    from gmpy2 import digits
    def A052404(n): return int(''.join(str(int(d)+1) if d>'1' else d for d in digits(n-1,9))) # Chai Wah Wu, Aug 30 2024
  • sh
    seq 0 1000 | grep -v 2; # Joerg Arndt, May 29 2011
    

Formula

If the offset were changed to 0: a(0) = 0, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<10 and x<>2 then y else if x mod 10 = 2 then f(y+1,y+1) else f(floor(x/10),y). - Reinhard Zumkeller, Mar 02 2008
a(n) = replace digits d > 1 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{k>1} 1/a(k) = A082831 = 19.257356... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 14 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

A214676 A(n,k) is n represented in bijective base-k numeration; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 1, 11, 1, 2, 111, 1, 2, 11, 1111, 1, 2, 3, 12, 11111, 1, 2, 3, 11, 21, 111111, 1, 2, 3, 4, 12, 22, 1111111, 1, 2, 3, 4, 11, 13, 111, 11111111, 1, 2, 3, 4, 5, 12, 21, 112, 111111111, 1, 2, 3, 4, 5, 11, 13, 22, 121, 1111111111
Offset: 1

Views

Author

Alois P. Heinz, Jul 25 2012

Keywords

Comments

The digit set for bijective base-k numeration is {1, 2, ..., k}.

Examples

			Square array A(n,k) begins:
:         1,   1,  1,  1,  1,  1,  1,  1, ...
:        11,   2,  2,  2,  2,  2,  2,  2, ...
:       111,  11,  3,  3,  3,  3,  3,  3, ...
:      1111,  12, 11,  4,  4,  4,  4,  4, ...
:     11111,  21, 12, 11,  5,  5,  5,  5, ...
:    111111,  22, 13, 12, 11,  6,  6,  6, ...
:   1111111, 111, 21, 13, 12, 11,  7,  7, ...
:  11111111, 112, 22, 14, 13, 12, 11,  8, ...
		

Crossrefs

A(n+1,n) gives A010850.

Programs

  • Maple
    A:= proc(n, b) local d, l, m; m:= n; l:= NULL;
          while m>0 do  d:= irem(m, b, 'm');
            if d=0 then d:=b; m:=m-1 fi;
            l:= d, l
          od; parse(cat(l))
        end:
    seq(seq(A(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    A[n_, b_] := Module[{d, l, m}, m = n; l = Nothing; While[m > 0, {m, d} = QuotientRemainder[m, b]; If[d == 0, d = b; m--]; l = {d, l}]; FromDigits @ Flatten @ l];
    Table[A[n, d-n+1], {d, 1, 12}, {n, 1, d}] // Flatten (* Jean-François Alcover, May 28 2019, from Maple *)

A238940 Powers of 4 without the digit '0' in their decimal expansion.

Original entry on oeis.org

1, 4, 16, 64, 256, 16384, 65536, 262144, 16777216, 268435456, 4294967296, 17179869184, 68719476736, 4722366482869645213696, 75557863725914323419136, 77371252455336267181195264
Offset: 1

Views

Author

M. F. Hasler, Mar 07 2014

Keywords

Comments

Conjectured to be finite and complete. See the OEIS wiki page for further information, references and links.

Crossrefs

For the zeroless numbers (powers x^n), see A238938, A238939, A238940, A195948, A238936, A195908, A195946, A195945, A195942, A195943.
For the corresponding exponents, see A007377, A008839, A030700, A030701, A030702, A030703, A030704, A030705, A030706, A195944.
For other related sequences, see A052382, A027870, A102483.

Programs

  • Mathematica
    Select[4^Range[0,50],DigitCount[#,10,0]==0&] (* Harvey P. Dale, Aug 31 2021 *)
  • PARI
    for(n=0,99,vecmin(digits(4^n))&& print1(4^n","))

Formula

a(n)=4^A030701(n).

Extensions

Keyword:fini removed by Jianing Song, Jan 28 2023 as finiteness is only conjectured.

A052043 Squares of primes lacking the digit zero in their decimal expansion.

Original entry on oeis.org

4, 9, 25, 49, 121, 169, 289, 361, 529, 841, 961, 1369, 1681, 1849, 3481, 3721, 4489, 5329, 6241, 6889, 7921, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 24649, 26569, 27889, 29929, 32761, 36481, 37249, 44521, 49729, 51529, 52441, 54289
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1999

Keywords

Comments

Intersection of A052382 and A001248; A168046(a(n))*A064911(a(n))*A010052(a(n)) = 1. - Reinhard Zumkeller, Dec 01 2009

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[100]]^2,DigitCount[#,10,0]==0&] (* Harvey P. Dale, Mar 18 2012 *)
  • PARI
    is(n)=my(d=digits(n));vecsort(d)[1]&&issquare(n,&n)&&isprime(n) \\ Charles R Greathouse IV, Jun 05 2013

Formula

a(n) = A052042(n)^2. - R. J. Mathar, Jul 23 2025

A052421 Numbers without 8 as a digit.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Crossrefs

Cf. A004183, A004727, A038616 (subset of primes), A082837 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A007095 (without 9).

Programs

  • Haskell
    a052421 = f . subtract 1 where
    f 0 = 0
    f v = 10 * f w + if r > 7 then r + 1 else r where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 8 in Intseq(n) ]; // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local l, m; l, m:= 0, n-1;
          while m>0 do l:= (d->
            `if`(d<8, d, d+1))(irem(m, 9, 'm')), l
          od; parse(cat(l))/10
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 01 2016
  • Mathematica
    Select[Range[0,100],DigitCount[#,10,8]==0&] (* Harvey P. Dale, Oct 11 2012 *)
  • PARI
    lista(nn)=for (n=0, nn, if (!vecsearch(vecsort(digits(n),,8), 8), print1(n, ", "));); \\ Michel Marcus, Feb 22 2015
    
  • PARI
    /* See OEIS wiki page (cf. LINKS) for more programs. */
    apply( {A052421(n)=fromdigits(apply(d->d+(d>7),digits(n-1,9)))}, [1..99]) \\ a(n)
    select( {is_A052421(n)=!setsearch(Set(digits(n)),8)}, [0..99]) \\ used in A038616
    next_A052421(n, d=digits(n+=1))={for(i=1,#d, d[i]==8&&return((1+n\d=10^(#d-i))*d)); n} \\ Least a(k) > n. Used in A038616. - M. F. Hasler, Jan 11 2020
    
  • Python
    from gmpy2 import digits
    def A052421(n): return int(digits(n-1,9).replace('8','9')) # Chai Wah Wu, Jun 28 2025
  • sh
    seq 0 1000 | grep -v 8; # Joerg Arndt, May 29 2011
    

Formula

a(n) = replace digits d > 7 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{n>1} 1/a(n) = A082837 = 22.726365... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 13 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

A084544 Alternate number system in base 4.

Original entry on oeis.org

1, 2, 3, 4, 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44, 111, 112, 113, 114, 121, 122, 123, 124, 131, 132, 133, 134, 141, 142, 143, 144, 211, 212, 213, 214, 221, 222, 223, 224, 231, 232, 233, 234, 241, 242, 243, 244, 311, 312, 313, 314, 321
Offset: 1

Views

Author

Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003

Keywords

Examples

			From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(100)  = 1144.
a(10^3) = 33214.
a(10^4) = 2123434.
a(10^5) = 114122134.
a(10^6) = 3243414334.
a(10^7) = 211421121334.
a(10^8) = 11331131343334.
a(10^9) = 323212224213334. (End)
		

Crossrefs

Programs

  • Python
    def A084544(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join((str(((3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3)+1) for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

From Hieronymus Fischer, Jun 06 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1..4.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 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(k*(4^n-1)/3) = k*(10^n-1)/9, k = 1,2,3,4.
a((7*4^n-4)/3) = (13*10^n-4)/9 = 10^n + 4*(10^n-1)/9.
a((4^n-1)/3 - 1) = 4*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_4(3*n+1)-1)/9, equality holds for n=(4^k-1)/3, k>0.
a(n) > (4/10)*(10^log_4(3*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_4(3*n) = 2/45, for n --> infinity.
lim sup a(n)/10^log_4(3*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1 - 5z(j)^4 + 4z(j)^5)/((1-z(j))(1-z(j)^4)), where z(j) = x^4^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1-5(x^4^j)^4 + 4(x^4^j)^5)*x^4^j*f_j(x)/(1-x^4^j), where f_j(x) = 10^j*x^((4^j-1)/3)/(1-(x^4^j)^4). The f_j obey the recurrence f_0(x) = 1/(1-x^4), f_(j+1)(x) = 10x*f_j(x^4).
Also: g(x) = (1/(1-x))* (h_(4,0)(x) + h_(4,1)(x) + h_(4,2)(x) + h_(4,3)(x) - 4*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3) * (x^4^j)^k/(1-(x^4^j)^4).
(End)
a(n) = A045926(n) / 2. - Reinhard Zumkeller, Jan 01 2013

Extensions

Offset set to 1 according to A007931, A007932 by Hieronymus Fischer, Jun 06 2012

A324160 Number of zero-containing nonnegative integers <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11
Offset: 0

Views

Author

Hieronymus Fischer, Feb 15 2019

Keywords

Comments

This sequence represents the counting function of A011540.
n = n_max = 701 is the greatest number such that a(n) <= pi(n) [the number of primes <= n]. Thus, for all indices n > n_max, we have a(n) > pi(n). For n = n_max the number of primes is pi(n) = 126.
n = n_min = 510 is the least number (> 2) such that a(n) >= pi(n) [the number of primes <= n]. Thus, for all indices 2 < n < n_min, we have a(n) < pi(n). For n = n_min the number of primes is pi(n) = 97.

Examples

			a(10) = 2, since there are two numbers <= 10 which contain a '0'-digit (0 and 10).
a(100) = 11.
a(10^3) = 182.
a(10^4) = 2621.
a(10^5) = 33572.
a(10^6) = 402131.
a(10^7) = 4619162
a(10^8) = 51572441.
a(10^9) = 564151952.
a(10^10) = 6077367551.
a(10^20) = 86322626358560955101.
a(10^50) = 99420200289176487252583981229013676068210129037751 = 9.9420200289176... *10^49
a(10^100) = 9.9997011842625...13575501*10^99.
a(10^1000) = 9.999999999999...564125755001*10^999
(here, the first 45 digits are 9's).
		

Crossrefs

Programs

  • PARI
    a(n) = 1 + sum(k=1, n, vecmin(digits(k)) == 0); \\ Michel Marcus, Mar 20 2019

Formula

With m := floor(log_10(n)); k := Max_{j | j = 1..m and (floor(n/10^j) mod 10)*j = 0} = digit position of the leftmost '0' in n counted from the right (starting with 0), k = 0 if there is no '0' digit; b(n,k):= floor(n/10^k)*10^k:
a(n) = 2 + Sum_{j = 1..m} floor((b(n,k+1)-1)/10^j)*9^(j-1), if k = 0 (valid for n > 9),
a(n) = 2 + n mod 10^k + Sum_{j = 1..m} floor((b(n,k)-1)/10^j)*9^(j-1), if k > 0 (valid for n > 0),
a(n) = 2 + n mod 10^k - ceiling(fract(n/10))*(1-ceiling(k/(m+1))) + Sum_{j = 1..m} floor((b(n,k)-1)/10^j)*9^(j-1) (all k, valid for n > 0).
a(n) + A324161(n) = n + 1
a(A011540(n)) = n.
A011540(a(n)) <= n, for n >= 0.
A011540(a(n)) = n, iff n is a zero-containing number.
a(10*n + k) <= 9*a(n) + n - 8, k = 0..9, equality holds for k = 9, and also, if n is a zerofree number (i.e., contains no '0'-digit).
a(10*A052382(n) + k) = 10*A052382(n) + 1 - 9*n, k = 0..9.
Values for special indices:
a(k*(10^n-1)/9 - j) = k*(8*10^n - 9*9^n + 1)/72 + 1, n > 0, k = 1..9, j = 0..k.
a(k*10^n - j) = k*(10^n - 9^n) + 1 - (9^n - 1)/8, n >= 0, k = 1..10, j = 1..10.
a(10^n) = 10^n + 2 - (9^(n+1) - 1)/8, n > 0.
a(k*10^n + j) = k*(10^n - 9^n) + j + 2 - (9^n - 1)/8, n > 0, k = 1..9, 0 <= j < (10^(n+1)-1)/9 - 10^n.
With: d := log_10(9) = 0.95424250943932...
Upper bound:
a(n) <= n + 2 - ((9*n + 10)^d - 1)/8,
equality holds for n = (10^k - 1)/9 - 1, k > 0.
Lower bound:
a(n) >= n + 2 - (9*(n + 1)^d - 1)/8,
equality holds for n = 10^k - 1, k >= 0.
Asymptotic behavior:
a(n) <= n + 2 + (1/8) - (9^d/8)*n^d*(1 + O(1/n)).
a(n) >= n + 2 + (1/8) - (9/8)*n^d*(1 + O(1/n))).
a(n) = n*(1 + O(n^(d-1)) = n*(1 + O(1/n^0.045757490...)).
Lower and upper limits:
lim inf (a(n) - n)/n^d = -9/8, for n -> infinity.
lim sup (a(n) - n)/n^d = -9^d/8 = -1.0173931195971..., for n -> infinity.
From Hieronymus Fischer, Apr 04 2019: (Start)
Formulas for general bases b > 2:
With m := floor(log_b(n)); k := Max_{j | j=1..m and (floor(n/b^j) mod b)*j = 0} = digit position of the leftmost '0' in n counted from the right (starting with 0), k = 0 if there is no '0' digit; b(n,k):= floor(n/b^k)*b^k:
a(n) = 2 + Sum_{j=1..m} floor((b(n,k+1)-1)/b^j)*(b-1)^(j-1), if k = 0, valid for n > b-1;
a(n) = 2 + n mod b^k + Sum_{j=1..m} floor((b(n,k)-1)/b^j)*(b-1)^(j-1), if k > 0, valid for n > 0;
a(n) = 2 + n mod b^k - ceiling(fract(n/b))*(1-ceiling(k/(m+1))) + Sum_{j=1..m} floor((b(n,k)-1)/b^j)* (b-1)^(j-1), all k, valid for n > 0.
Formula for base b = 2: a(n) = (n + 1 - floor(log_2(n + 1))).
With d := d(b) := log(b - 1)/log(b):
Upper bound (b = 10 for this sequence):
a(n) <= n + 2 - (((b - 1)*n + b)^d - 1)/(b - 2),
equality holds for n = (b^k - 1)/(b - 1) - 1, k > 0.
Lower bound (b = 10 for this sequence):
a(n) >= n + 2 - ((b - 1)*(n + 1)^d - 1)/(b - 2),
equality holds for n = b^k - 1, k >= 0.
Asymptotic behavior (b = 10 for this sequence):
a(n) = n*(1 + O(n^(d(b)-1)), for b > 2,
a(n) = n*(1 + O(log(n)/n)), for b = 2.
Lower and upper limits:
lim inf (a(n) - n)/n^d(b) = -(b - 1)/(b - 2), for n -> infinity, for b > 2.
lim sup (a(n) - n)/n^d(b) = -(b - 1)^d/(b - 2) for n -> infinity, for b > 2.
In case of b = 2:
lim (a(n) - n)/log(n) = -1/log(2), for n -> infinity.
(End)

A034305 Zeroless nonprimes that remain nonprime if any digit is deleted.

Original entry on oeis.org

14, 16, 18, 44, 46, 48, 49, 64, 66, 68, 69, 81, 84, 86, 88, 91, 94, 96, 98, 99, 122, 124, 125, 126, 128, 142, 144, 145, 146, 148, 152, 154, 155, 156, 158, 162, 164, 165, 166, 168, 182, 184, 185, 186, 188, 212, 214, 215, 216, 218, 221, 222, 224, 225, 226, 228
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A052382.

Programs

  • Haskell
    a034305 n = a034305_list !! (n-1)
    a034305_list = filter f $ drop 9 a052382_list where
      f x = a010051' x == 0 &&
            (all (== 0) $ map (a010051' . read) $
             zipWith (++) (inits $ show x) (tail $ tails $ show x))
    -- Reinhard Zumkeller, May 10 2015
    
  • Mathematica
    npQ[n_]:=!PrimeQ[n]&&FreeQ[IntegerDigits[n],0]&&AllTrue[FromDigits/@ Table[Drop[IntegerDigits[n],{k}],{k,IntegerLength[n]}],!PrimeQ[#]&]; Select[Range[10,300],npQ](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 19 2021 *)
  • PARI
    is(n)=my(d=digits(n)); if(#d<2 || vecmin(d)<1 || isprime(n), return(0)); for(i=0,#d-1, if(isprime(fromdigits(vecextract(d,2^#d-1-2^i))), return(0))); 1 \\ Charles R Greathouse IV, Jun 25 2017
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 10 or isprime(n): return False
        s = str(n)
        return "0" not in s and not any(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    print([k for k in range(229) if ok(k)]) # Michael S. Branicky, Jan 15 2023

Extensions

Definition corrected by T. D. Noe, Apr 02 2008
Single-digit terms removed again by Georg Fischer, Jun 21 2021

A061844 Squares that remain squares if you decrease every digit by 1.

Original entry on oeis.org

1, 36, 3136, 24336, 5973136, 71526293136, 318723477136, 264779654424693136, 24987377153764853136, 31872399155963477136, 58396845218255516736, 517177921565478376336, 252815272791521979771662766736, 518364744896318875336864648336, 554692513628187865132829886736
Offset: 1

Views

Author

Erich Friedman, Jun 23 2001

Keywords

Comments

The terms may be calculated efficiently by solving x^2 - y^2 = 111...1; this is done by factoring 111..1 = (x + y)(x - y).
Note that some solutions will produce a square containing a zero digit so the solution is impermissible; for example, 460^2 - 317^2 = 111111 but 460^2 = 211600. - Wendy Appleby, Sep 20 2015
Except for a(1) = 1, we don't allow decreasing the digits to create a leading 0. Thus 126736 = 356^2 is not included, even though 126736 - 111111 = 15625 = 125^2. - Robert Israel, Dec 30 2015
If it exists, a(79) > 10^262. - Max Alekseyev, Sep 05 2023
From Robert Israel, Jan 04 2016: (Start)
The sequence may well be finite.
It is known that A000005(n) = O(n^epsilon) for all epsilon>0.
Therefore if 1 < c < 10/9, for d sufficiently large (10^d-1)/9 has fewer than c^d divisors, and thus fewer than c^d possible candidates for x^2 having d digits.
Heuristically, x^2 has probability ~ (9/10)^d of having no digits 0.
Thus we expect fewer than (9c/10)^d terms having d digits.
Since Sum_d (9c/10)^d converges, we expect only finitely many terms.
Of course, this is only a heuristic argument, but it seems to fit well with the data. (End)

Examples

			13225 = 115^2 and 24336 = 156^2.
		

Crossrefs

Programs

  • Maple
    A:= {1}:
    for d from 1 to 96 do
      r:= (10^d-1)/9;
      f:= subs(X=10,factors((X^d-1)/(X-1))[2]);
      q:= map(t -> op(map(s -> [s[1],t[2]*s[2]], ifactors(t[1])[2])),f);
      divs:= {1};
    for t in q do
        divs:= map(x -> seq(x*t[1]^j,j=0..t[2]),divs)
      od;
      for t in select(s -> s^2 > r, divs) do
        x:= (t + r/t)/2;
        if ilog10(x^2) = d-1 and x^2 > 2*10^(d-1) and not has(convert(x^2,base,10),0) then
          A:= A union {x^2};
        fi
      od
    od:
    sort(convert(A,list)); # Robert Israel, Dec 30 2015
  • Mathematica
    For[digits = 1, digits <= 30, digits++, n = (10^digits - 1)/9; divList = Select[Divisors[n], (#1 >= Sqrt[n])&]; For[j = 1, j <= Length[divList], j++, x = (divList[[j]] + n/divList[[j]])/2; y = (divList[[j]] - n/divList[[j]])/2; dx = IntegerDigits[x^2]; dy = IntegerDigits[y^2]; If[(Length[dx] == digits) && (Length[dy] == digits) && (Select[dx, (#1 == 0)&] == {}), Print[x^2]]]]
    Flatten@Prepend[Table[Select[#[[Ceiling[(Length[#] + 1)/2] ;;]] &@(# + Reverse@#)/2 &@Divisors[(10^n - 1)/9], IntegerLength[#^2] == n && (#[[1]] != 1 && FreeQ[#, 0]&[IntegerDigits[#^2]])&]^2, {n, 30}], 1] (* JungHwan Min, Dec 29 2015 *)
    Join[{1},Select[Select[Flatten[Table[#^2&/@(x/.Solve[{x^2-y^2 == FromDigits[ PadRight[{},n,1]],x>0,y>0},{x,y},Integers]),{n,2,30}]], DigitCount[ #,10,0]==0&&IntegerDigits[#][[1]]>1&]// Union,IntegerQ[ Sqrt[ FromDigits[IntegerDigits[#]-1]]]&]] (* Harvey P. Dale, Apr 16 2016 *)

Formula

a(n) = A048379(A061843(n)). - Max Alekseyev, Jul 26 2023

Extensions

More terms and program from Jonathan Cross (jcross(AT)wcox.com), Oct 08 2001

A084545 Alternate number system in base 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55, 111, 112, 113, 114, 115, 121, 122, 123, 124, 125, 131, 132, 133, 134, 135, 141, 142, 143, 144, 145, 151, 152, 153, 154, 155, 211, 212, 213, 214, 215, 221, 222
Offset: 1

Views

Author

Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003

Keywords

Examples

			From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(100)  = 345.
a(10^3) = 12445.
a(10^4) = 254445.
a(10^5) = 11144445.
a(10^6) = 223444445.
a(10^7) = 4524444445.
a(10^8) = 145544444445.
a(10^9) = 3521444444445. (End)
		

Crossrefs

Programs

  • PARI
    a(n) = my (w=5); while (n>w, n -= w; w *= 5); my (d=digits(w+n-1, 5)); d[1] = 0; fromdigits(d) + (10^(#d-1)-1)/9 \\ Rémy Sigrist, Dec 04 2019

Formula

From Hieronymus Fischer, Jun 06 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1..5.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 5)*10^j, where m = floor(log_5(4*n+1)), b(j) = floor((4*n+1-5^m)/(4*5^j)).
a(k*(5^n-1)/4) = k*(10^n-1)/9, for k = 1,2,3,4,5.
a((9*5^n-5)/4) = (14*10^n-5)/9 = 10^n + 5*(10^n-1)/9.
a((5^n-1)/4 - 1) = 5*(10^(n-1)-1)/9, n>1.
a(n) <= (10^log_5(4*n+1)-1)/9, equality holds for n=(5^k-1)/4, k>0.
a(n) > (5/10)*(10^log_5(4*n+1)-1)/9, n>0.
lim inf a(n)/10^log_5(4*n) = 1/18, for n --> infinity.
lim sup a(n)/10^log_5(4*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/4)*(1-x))^(-1) sum_{j>=0} 10^j*z(j)^(5/4)*(1 - 6z(j)^5 + 5z(j)^6)/((1-z(j))(1-z(j)^5)), where z(j) = x^5^j.
Also: g(x) = (1/(1-x)) sum_{j>=0} (1-6(x^5^j)^5+5(x^5^j)^6)*x^5^j*f_j(x)/(1-x^5^j), where f_j(x) = 10^j*x^((5^j-1)/4)/(1-(x^5^j)^5). The f_j obey the recurrence f_0(x) = 1/(1-x^5), f_(j+1)(x) = 10x*f_j(x^5).
Also: g(x) = 1/(1-x))*(h_(5,0)(x) + h_(5,1)(x) + h_(5,2)(x) + h_(4,1)(x) + h_(5,4)(x) - 5*h_(5,5)(x)), where h_(5,k)(x) = sum_{j>=0} 10^j*x^((5^(j+1)-1)/4) * (x^5^j)^k/(1-(x^5^j)^5).
(End)

Extensions

Offset set to 1 according to A007931, A007932 and more terms added by Hieronymus Fischer, Jun 06 2012
Previous Showing 51-60 of 224 results. Next