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.

Showing 1-10 of 10 results.

A111456 Pandigitals in some base (A061845) with an extra property: each number formed by the first i digits is divisible by i (digits in the pandigital base).

Original entry on oeis.org

2, 108, 228, 13710, 44790, 6996920, 11128712, 12306056, 3816547290, 7838911147538198
Offset: 1

Views

Author

Martin Fuller, Nov 15 2005

Keywords

Comments

Finite? There are no more terms up to base 40. A probabilistic argument says higher bases are increasingly unlikely to produce a value.
There is no further term up to base=56; and no solution for base=60. Furthermore all bases are even: if the number formed by the first (base-1) digits is x, then x is divisible by (base-1) and x==base*(base-1)/2 mod (base-1), because the base-th digit is zero. From this the base is even. We can also see that if the i-th leftmost digit is d, then gcd(base,i)=gcd(base,d). To see this let g=gcd(base,i) and the number formed by the first i digit is x, then i divides x=k*base+d for some k, from this g divides d. And obviously g divides base, so g divides gcd(base,d), but it can't be larger than g, otherwise say gcd(base,d)=h>g, then in every h-th position we see a digit divisible by h, and the i-th digit is also divisible by h. This is a contradiction, there would be more than base/h digits divisible by h. - Robert Gerbicz, Mar 15 2016
Base corresponding to the terms: 2, 4, 4, 6, 6, 8, 8, 8, 10, 14. Terms written in its base: 10, 1230, 3210, 143250, 543210, 32541670, 52347610, 56743210, 3816547290, 9c3a5476b812d0 - Hans Havermann, May 26 2020
Subsequence of the terms of A256112 which are divisible by the base b in which they are pandigital (which is the least integer such that b^b > a(n)). In A256112 divisibility by i is required only for the numbers formed by the first i <= b-1 digits, while here it must also hold for i = b. - M. F. Hasler, May 26 2020

Examples

			E.g. 13710 = 143250[6] (i.e., in base 6) is pandigital and 14[6] = 10[10] is even, 143[6] = 63[10] is divisible by 3, 1432[6] = 380[10] is divisible by 4, etc.
3816547290 is a well-known example in base 10.
		

Crossrefs

Programs

  • Python
    def dgen(n, b):
        if n == 1:
            t = list(range(b))
            for i in range(1, b):
                u = list(t)
                u.remove(i)
                yield i, u
        else:
            for d, v in dgen(n-1, b):
                for g in v:
                    k = d*b+g
                    if not k % n:
                        u = list(v)
                        u.remove(g)
                        yield k, u
    print([a for n in range(2, 15, 2) for a, b in dgen(n, n)]) # Chai Wah Wu, Jun 07 2015

Extensions

Keyword 'fini' is removed as finiteness is not proved. - Max Alekseyev, Dec 15 2014
Offset corrected to 1 by M. F. Hasler, May 27 2020

A256112 Pandigitals in some base b (A061845) with an extra property: each number formed by the first i digits is divisible by i (digits in the pandigital base b) for 1 <= i <= b-1.

Original entry on oeis.org

2, 19, 75, 99, 108, 135, 228, 2102, 8525, 10535, 13685, 13710, 26075, 31835, 44790, 203367, 247215, 477543, 518703, 576495, 620343, 743823, 3850399, 6996535, 6996871, 6996920, 7375543, 8947631, 11128712, 12306056, 78473956, 89789620, 156414388, 222029284, 306600196
Offset: 1

Views

Author

Chai Wah Wu, Jun 07 2015

Keywords

Comments

A111456 is the subsequence of terms divisible by the considered base (which is the least b such b^b > a(n)).
Is it true that there are no terms for base b > 16 and b even?

Examples

			247215 = 2046513[7] (i.e., in base 7) is pandigital and 20[7] = 14 is even, 204[7] = 102 is divisible by 3, etc. up to 204651[7] = 35316 which is divisible by 6.
In contrast to A111456, the number as a whole does not need to be divisible by the considered base. - _M. F. Hasler_, May 27 2020
		

Crossrefs

Cf. A111456.

Programs

  • Python
    def dgen(n,b):
        if n == 1:
            t = list(range(b))
            for i in range(1,b):
                u = list(t)
                u.remove(i)
                yield i, u
        else:
            for d, v in dgen(n-1,b):
                for g in v:
                    k = d*b+g
                    if not k % n:
                        u = list(v)
                        u.remove(g)
                        yield k, u
    A256112_list = lambda n: [a*k+b[0] for k in range(2, n) for a, b in dgen(k-1, k)]
    print(A256112_list(10))

Extensions

Edited by M. F. Hasler, May 27 2020

A049363 a(1) = 1; for n > 1, smallest digitally balanced number in base n.

Original entry on oeis.org

1, 2, 11, 75, 694, 8345, 123717, 2177399, 44317196, 1023456789, 26432593615, 754777787027, 23609224079778, 802772380556705, 29480883458974409, 1162849439785405935, 49030176097150555672, 2200618769387072998445, 104753196945250864004691, 5271200265927977839335179
Offset: 1

Views

Author

Keywords

Comments

A037968(a(n)) = n and A037968(m) < n for m < a(n). - Reinhard Zumkeller, Oct 27 2003
Also smallest pandigital number in base n. - Franklin T. Adams-Watters, Nov 15 2006

Examples

			a(6) = 102345_6 = 1*6^5 + 2*6^3 + 3*6^2 + 4*6^1 + 5*6^0 = 8345.
		

Crossrefs

Column k=1 of A061845 and A378000 (for n>1).

Programs

  • Haskell
    a049363 n = foldl (\v d -> n * v + d) 0 (1 : 0 : [2..n-1])
    -- Reinhard Zumkeller, Apr 04 2012
    
  • Maple
    a:= n-> n^(n-1)+add((n-i)*n^(i-1), i=1..n-2):
    seq(a(n), n=1..23);  # Alois P. Heinz, May 02 2020
  • Mathematica
    Table[FromDigits[Join[{1,0},Range[2,n-1]],n],{n,20}] (* Harvey P. Dale, Oct 12 2012 *)
  • PARI
    A049363(n)=n^(n-1)+sum(i=1,n-2,n^(i-1)*(n-i))  \\ M. F. Hasler, Jan 10 2012
    
  • PARI
    A049363(n)=if(n>1,(n^n-n)/(n-1)^2+n^(n-2)*(n-1)-1,1)  \\ M. F. Hasler, Jan 12 2012
    
  • Python
    def A049363(n): return (n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1 if n>1 else 1 # Chai Wah Wu, Mar 13 2024

Formula

a(n) = (102345....n-1) in base n. - Ulrich Schimke (ulrschimke(AT)aol.com)
For n > 1, a(n) = (n^n-n)/(n-1)^2 + n^(n-2)*(n-1) - 1 = A023811(n) + A053506(n). - Franklin T. Adams-Watters, Nov 15 2006
a(n) = n^(n-1) + Sum_{m=2..n-1} m * n^(n - 1 - m). - Alexander R. Povolotsky, Sep 18 2022

Extensions

More terms from Ulrich Schimke (ulrschimke(AT)aol.com)

A062813 a(n) = Sum_{i=0..n-1} i*n^i.

Original entry on oeis.org

0, 2, 21, 228, 2930, 44790, 800667, 16434824, 381367044, 9876543210, 282458553905, 8842413667692, 300771807240918, 11046255305880158, 435659737878916215, 18364758544493064720, 824008854613343261192, 39210261334551566857170, 1972313422155189164466189, 104567135734072022160664820
Offset: 1

Views

Author

Olivier Gérard, Jun 23 2001

Keywords

Comments

Largest Katadrome (number with digits in strict descending order) in base n.
The largest permutational number (A134640) of order n. These numbers are isomorphic with antidiagonal permutation matrices of order n. Where diagonal matrices are a[i,1+n-i]=1 {i=1,n} a[i<>1+n-i]=0 for smallest permutational numbers of order n see A023811. - Artur Jasinski, Nov 07 2007
Permutational numbers A134640 isomorphic with permutation matrix generators of cyclic groups, n-th root of unity matrices. - Artur Jasinski, Nov 07 2007
Rephrasing: Largest pandigital number in base n (in the sense of A050278, which is base 10); e.g., a(10) = A050278(3265920), its final term. With a(1) = 1 instead of 0, also accommodates unary (A000042). - Rick L. Shepherd, Jul 10 2017

Crossrefs

Last elements of rows of A061845 (for n>1).

Programs

  • Haskell
    a062813 n = foldr (\dig val -> val * n + dig) 0 [0 .. n - 1]
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Maple
    0,seq(n*((n-2)*n^n + 1)/(n-1)^2,n=2..100); # Robert Israel, Sep 03 2014
  • Mathematica
    Table[Sum[i*n^i, {i, 0, -1 + n}], {n, 17}] (* Olivier Gérard, Jun 23 2001 *)
    a[n_] := FromDigits[ Range[ n-1, 0, -1], n]; Array[a, 18] (* Robert G. Wilson v, Sep 03 2014 *)
  • PARI
    a(n) = sum(i=0,n-1,i*n^i)
    
  • PARI
    a(n) = if (n==1,0, my(t=n^n); t-(t-n)/(n-1)^2); \\ Joerg Arndt, Sep 03 2014
    
  • Python
    def A062813(n): return (m:=n**n)-(m-n)//(n-1)**2 if n>1 else 0 # Chai Wah Wu, Mar 18 2024

Formula

a(n) = n^n - (n^n-n)/(n-1)^2 for n>1. - Dean Hickerson, Jun 26 2001
a(n) = A134640(n, A000142(n)). - Reinhard Zumkeller, Aug 29 2014

A134640 Permutational numbers (numbers with k different digits in k-positional system).

Original entry on oeis.org

0, 1, 2, 5, 7, 11, 15, 19, 21, 27, 30, 39, 45, 54, 57, 75, 78, 99, 108, 114, 120, 135, 141, 147, 156, 177, 180, 198, 201, 210, 216, 225, 228, 194, 198, 214, 222, 238, 242, 294, 298, 334, 346, 358, 366, 414, 422, 434, 446, 482, 486, 538, 542, 558, 566, 582, 586
Offset: 1

Views

Author

Artur Jasinski, Nov 05 2007, Nov 07 2007, Nov 08 2007

Keywords

Comments

Note that leading zeros are allowed in these numbers.
a(1) is the 1-positional system 1!=1 numbers
a(2) to a(3) are two=2! 2-positional system numbers
a(4) to a(9) are six=3! 3-positional system numbers
a(10) to a(33) are 24=4! 4-positional system numbers
a(34) to a(153) are 120=5! 5-positional system numbers
...
There are a(!k)-a(Sum[m!,1,k])=a(A003422)-a(A007489) k-positional system k! numbers
The name permutational numbers arises because each permutation of k elements is isomorphic with one and only one of member of this sequence and conversely each number in this sequence is isomorphic with one and only one permutation of k elelmnts or its equivalent permutation matrix.
T(n,1) = A023811(n); T(n,A000142(n)) = A062813(n). - Reinhard Zumkeller, Aug 29 2014

Examples

			We build permutational numbers:
a(1)=0 in unitary positional system we have only one digit 0
a(2)=1 because in binary positional system smaller number with two different digits is 01 = 1
a(3)=2 because in binary positional system bigger number with two different digits is 10 = 2 (binary system is over)
a(4)=5 because smallest number in ternary system with 3 different digits is 012=5
a(5)=7 second number in ternary system with 3 different digits is 021=7
a(6)=11 third number in ternary system with 3 different digits is 102=11
a(7)=15 120=15
etc.
		

Crossrefs

Cf. A003422, A007489, A061845, A000142 (row lengths excluding 1st term).
Cf. A023811, A062813, A000142 (row lengths), A007489 (sums of row lengths).

Programs

  • Haskell
    import Data.List (permutations, sort)
    a134640 n k = a134640_tabf !! (n-1) !! (k-1)
    a134640_row n = sort $
       map (foldr (\dig val -> val * n + dig) 0) $ permutations [0 .. n - 1]
    a134640_tabf = map a134640_row [1..]
    a134640_list = concat a134640_tabf
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Mathematica
    a = {}; b = {}; Do[AppendTo[b, n]; w = Permutations[b]; Do[j = FromDigits[w[[m]], n + 1]; AppendTo[a, j], {m, 1, Length[w]}], {n, 0, 5}]; a (*Artur Jasinski*)
    Flatten[Table[FromDigits[#,n]&/@Permutations[Range[0,n-1]],{n,5}]] (* Harvey P. Dale, Dec 09 2014 *)
  • Python
    from itertools import permutations
    def fd(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
    def row(n): return [fd(d, n) for d in permutations(range(n))]
    print([an for r in range(1, 6) for an in row(r)]) # Michael S. Branicky, Oct 21 2022

Extensions

Corrected indices in examples. Replaced dashes in comments by the word "to" - R. J. Mathar, Aug 26 2009

A378073 Positive integers that are digitally balanced in some integer base b >= 2.

Original entry on oeis.org

2, 9, 10, 11, 12, 15, 19, 21, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 75, 78, 99, 108, 114, 120, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178, 180, 184, 195, 197, 198, 201, 202, 204, 209, 210, 212, 216, 225, 226, 228
Offset: 1

Views

Author

Paolo Xausa, Nov 16 2024

Keywords

Comments

A digitally balanced number in base b contains every digit from 0 to b-1 in equal amount.
This is the set of all of the distinct terms in A378000.

Examples

			99 is a term because it's a digitally balanced number in base 5 (99 = 12034_5).
135 is a term because it's a digitally balanced number in two bases (135 = 10000111_2 = 2013_4).
		

Crossrefs

Cf. A049364, A061845, A065963, A378000, A378080 (complement).
Supersequence of A378104.
Positions of positive terms in A378191.

Programs

  • Mathematica
    A378073Q[n_] := Module[{b = 1, len}, While[(len = IntegerLength[n, ++b]) >= b && !(Divisible[len, b] && SameQ @@ DigitCount[n, b])]; len >= b];
    Select[Range[500], A378073Q]

A350510 Square array read by descending antidiagonals: A(n,k) is the least number m such that the base-n expansion of m contains the base-n expansions of 1..k as substrings.

Original entry on oeis.org

1, 2, 1, 6, 5, 1, 12, 11, 6, 1, 44, 38, 27, 7, 1, 44, 95, 75, 38, 8, 1, 92, 285, 331, 194, 51, 9, 1, 184, 933, 1115, 694, 310, 66, 10, 1, 1208, 2805, 4455, 3819, 1865, 466, 83, 11, 1, 1256, 7179, 17799, 16444, 8345, 3267, 668, 102, 12, 1
Offset: 2

Views

Author

Davis Smith, Jan 02 2022

Keywords

Examples

			Square array begins:
n/k|| 1 |  2 |   3 |    4 |     5 |      6 |       7 |        8 |
================================================================|
2  || 1 |  2 |   6 |   12 |    44 |     44 |      92 |      184 |
3  || 1 |  5 |  11 |   38 |    95 |    285 |     933 |     2805 |
4  || 1 |  6 |  27 |   75 |   331 |   1115 |    4455 |    17799 |
5  || 1 |  7 |  38 |  194 |   694 |   3819 |   16444 |    82169 |
6  || 1 |  8 |  51 |  310 |  1865 |   8345 |   55001 |   289577 |
7  || 1 |  9 |  66 |  466 |  3267 |  22875 |  123717 |   947260 |
8  || 1 | 10 |  83 |  668 |  5349 |  42798 |  342391 |  2177399 |
9  || 1 | 11 | 102 |  922 |  8303 |  74733 |  672604 |  6053444 |
10 || 1 | 12 | 123 | 1234 | 12345 | 123456 | 1234567 | 12345678 |
11 || 1 | 13 | 146 | 1610 | 17715 | 194871 | 2143588 | 23579476 |
		

Crossrefs

The first n - 1 terms of rows: 2: A047778, 3: A048435, 4: A048436, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: A007908, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447.

Programs

  • Mathematica
    T[n_,k_]:=(m=0;While[!ContainsAll[Subsequences@IntegerDigits[++m,n],IntegerDigits[Range@k,n]]];m);Flatten@Table[T[1+i,j+1-i],{j,9},{i,j}] (* Giorgos Kalogeropoulos, Jan 09 2022 *)
  • PARI
    A350510_rows(n,k,N=0)= my(L=List(concat(apply(z->fromdigits([1..z],n),[1..n-1]),if(n>2,fromdigits(concat([1,0],[2..n-1]),n),[]))),T1(x)=digits(x,n),T2(x)=fromdigits(x,n),A(x)=my(S=T1(x));setbinop((y,z)->T2(S[y..z]),[1..#S]),N=if(N,N,L[#L]),A1=A(N));while(#Lsetsearch(A1,z),[1..#L+1])),A1=A(N++));listput(L,N));Vec(L)

Formula

For k < n, A(n,k) = A(n,k - 1)*n + k = Sum_{i=1..k} i*(n^(k - i)).
A(n,n) = A049363(n).
A(n,2) = A057544(n).
For n > 3, A(n,3) = A102305(n).
A(n,n - 1) = A023811(n).

A384212 a(n) is the number of bases >= 2 in which the alternating sum of digits of n is equal to 0.

Original entry on oeis.org

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

Views

Author

Felix Huber, May 24 2025

Keywords

Comments

The alternating sum of digits of n is equal to 1 for base n and equal to n for bases > n.

Examples

			a(72) = 10 because the alternating sum of digits of n is equal to 0 in the 10 bases 2 [1, 0, 0, 1, 0, 0, 0], 3 [2, 2, 0, 0], 5 [2, 4, 2], 7 [1, 3, 2], 8 [1, 1, 0], 11 [6, 6], 17 [4, 4], 23 [3, 3], 35 [2, 2] and 71 [1, 1].
		

Crossrefs

Programs

  • Maple
    A384212:=proc(n)
        local a,b,c,i;
        a:=0;
        for b from 2 to n-1 do
            c:=convert(n,'base',b);
        	   if add(c[i]*(-1)^i,i=1..nops(c))=0 then
               a:=a+1
            fi
        od;
        return a
    end proc;
    seq(A384212(n),n=1..87);
    A384212bases:=proc(n)
        local L,b,c,i;
        L:=[];
        for b from 2 to n-1 do
            c:=convert(n,'base',b);
        	if add(c[i]*(-1)^i,i=1..nops(c))=0 then
                L:=[op(L),b,ListTools:-Reverse(c)]
            fi
        od;
        return op(L)
    end proc;
    A384212bases(72);
  • Mathematica
    q[n_, b_] := Module[{d = IntegerDigits[n, b]}, Sum[(-1)^k*d[[k]], {k, 1, Length[d]}] == 0 ]; a[n_] := Count[Range[2, n-1], ?(q[n, #] &)]; Array[a, 100] (* _Amiram Eldar, May 24 2025 *)
  • PARI
    a(n) = sum(b=2, n-1, my(d=digits(n, b)); sum(k=1, #d, (-1)^k*d[k]) == 0); \\ Michel Marcus, May 24 2025
  • Python
    from sympy.ntheory import digits
    def s(v): return sum(v[::2]) - sum(v[1::2])
    def a(n): return sum(1 for b in range(2, n) if s(digits(n, b)[1:]) == 0)
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, May 24 2025
    

Formula

Trivial bounds: 1 <= a(n) <= n - 2 for n >= 3 because the representation of n in base n-1 is [1,1] and the alternating sum of digits of n is > 0 for bases >= n.

A384923 a(n) is the smallest number of leading significant digits of the square root of the n-th nonsquare that includes all decimal digits.

Original entry on oeis.org

19, 23, 37, 39, 45, 36, 27, 17, 25, 15, 36, 19, 20, 36, 25, 37, 28, 13, 27, 52, 39, 17, 38, 27, 26, 17, 23, 24, 37, 19, 25, 26, 26, 41, 58, 57, 25, 12, 25, 22, 24, 19, 33, 48, 23, 41, 49, 23, 32, 32, 23, 30, 19, 17, 31, 27, 24, 47, 24, 26, 18, 22, 19, 48, 31, 22
Offset: 1

Views

Author

Felix Huber, Jun 26 2025

Keywords

Comments

Squares are excluded by definition because a(n) would only exist for positive integers s that include all decimal digits. The smallest square s^2 for which a(n) would exist is 1023456789^2 = 1047463798950190521.

Examples

			The leading 19 significant digits of sqrt(2) are [1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8]. These digits include all decimal digits, with the digit '8' appearing for the first time at position 19. Since 2 is the first nonsquare, it follows that a(1) = 19.
		

Crossrefs

Programs

  • Maple
    A384923:=proc(n)
        local m,b,k;
        m:=n+floor(1/2+sqrt(n));
        b:=floor(log10(sqrt(m)));
        k:=9-b;
        while nops(convert(ListTools:-Reverse(convert(floor(10^k*sqrt(m)),'base',10)),set))<10 do
            k:=k+1
        od;
        return k+b+1
    end proc;
    seq(A384923(n),n=1..66);
  • Python
    from itertools import count
    from math import isqrt
    def A384923(n):
        m = n+(k:=isqrt(n))+(n>k*(k+1))
        return 1+next(n for n in count(9) if len(set(str(isqrt(10**(n<<1)*m))))==10) # Chai Wah Wu, Jul 01 2025

Formula

a(n) >= max(10, A384924(n)).
a(A113507(k) - floor(sqrt(A113507(k)))) = 10 for positive integers k.

A384436 a(n) is the number of distinct ways to represent n in any integer base >= 2 using only square digits.

Original entry on oeis.org

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

Views

Author

Felix Huber, May 29 2025

Keywords

Comments

The representations of n remain the same for bases greater than n, as they all consist solely of the digit n.

Examples

			The a(36) = 11 distinct ways to represent 36 using only square digits are [1,0,0,1,0,0] in base 2, [1,1,0,0] in base 3, [1,0,0] in base 6, [4,4] in base 8, [4,0] in base 9, [1,16] in base 20, [1,9] in base 27, [1,4] in base 32, [1,1] in base 35, [1,0] in base 36 and [36] in bases >= 37.
		

Crossrefs

Programs

  • Maple
    A384436:=proc(n)
        local a,b,c;
        a:=0;
        for b from 2 to n+1 do
            c:=convert(n,'base',b);
            if select(issqr,c)=c then
                a:=a+1
            fi
        od;
        return max(1,a)
    end proc;
    seq(A384436(n),n=0..81);
  • Mathematica
    a[n_] := Sum[Boole[AllTrue[IntegerDigits[n, b], IntegerQ[Sqrt[#]] &]], {b, 2, n+1}]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, May 29 2025 *)
  • PARI
    a(n) = sum(b=2, n+1, my(d=digits(n,b)); #select(issquare, d) == #d); \\ Michel Marcus, May 29 2025

Formula

Trivial lower bound for n >= 2: a(n) >= 2 for nonsquares n and a(n) >= 3 for squares n because in base 2 the representations of n consists only of the square digits '0' and '1', in base n the representation of n is [1,0] and in bases > n the representation of n is [n].
Showing 1-10 of 10 results.