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-6 of 6 results.

A016069 Numbers k such that k^2 contains exactly 2 distinct digits.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 21, 22, 26, 30, 38, 88, 100, 109, 173, 200, 212, 235, 264, 300, 1000, 2000, 3000, 3114, 10000, 20000, 30000, 81619, 100000, 200000, 300000, 1000000, 2000000, 3000000, 10000000, 20000000, 30000000, 100000000, 200000000, 300000000
Offset: 1

Views

Author

Keywords

Comments

10^k, 2*10^k, 3*10^k for k > 0 are terms. - Chai Wah Wu, Dec 17 2021
Subsequence of primes is A057659. - Bernard Schott, Jul 29 2022

Examples

			26 is in the sequence because 26^2 = 676 contains exactly 2 distinct digits.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, F24.

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a016069 n = a016069_list !! (n-1)
    a016069_list = filter ((== 2) . length . nub . show . (^ 2)) [0..]
    -- Reinhard Zumkeller, Apr 14 2011
    
  • Magma
    [n: n in [0..20000000] | #Set(Intseq(n^2)) eq 2]; // Vincenzo Librandi, Nov 04 2014
  • Mathematica
    Join[Select[Range[90000],Count[DigitCount[#^2],?(#!=0&)]==2&],Flatten[ NestList[ 10#&,{100000,200000,300000},5]]] (* _Harvey P. Dale, Mar 09 2013 *)
    Select[Range[20000000], Length[Union[IntegerDigits[#^2]]]==2&] (* Vincenzo Librandi, Nov 04 2014 *)
  • PARI
    /* needs version >= 2.6 */
    for (n=1, 10^9, if ( #Set(digits(n^2))==2, print1(n,", ") ) );
    /* Joerg Arndt, Mar 09 2013 */
    
  • Python
    from gmpy2 import is_square, isqrt
    from itertools import combinations, product
    A016069_list = []
    for g in range(2,10):
        n = 2**g-1
        for x in combinations('0123456789',2):
            for i,y in enumerate(product(x,repeat=g)):
                if i > 0 and i < n and y[0] != '0':
                    z = int(''.join(y))
                    if is_square(z):
                        A016069_list.append(int(isqrt(z)))
    A016069_list = sorted(A016069_list) # Chai Wah Wu, Nov 03 2014
    

Formula

a(n) = ((n-1) mod 3 + 1)*10^(ceiling(n/3)-7) for n >= 34 (conjectured). - Chai Wah Wu, Dec 17 2021

A018885 Squares using no more than two distinct digits.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 225, 400, 441, 484, 676, 900, 1444, 7744, 10000, 11881, 29929, 40000, 44944, 55225, 69696, 90000, 1000000, 4000000, 9000000, 9696996, 100000000, 400000000, 900000000, 6661661161, 10000000000
Offset: 1

Views

Author

Keywords

Comments

Is 6661661161 the largest term not of the form 10^k, 4*10^k or 9*10^k? Any larger ones must have >= 22 digits. - Robert Israel, Dec 03 2015

Crossrefs

Programs

  • Maple
    F:= proc(r, a, b, m)
    # get all squares starting with r, with at most m further digits, all from {a,b} where a < b
    local res,Ls,Us,L,U,looking;
    if issqr(r) then res:= r else res:= NULL fi;
    if m = 0 then return res fi;
    Ls:= r*10^m + a*(10^m-1)/9;
    Us:= r*10^m + b*(10^m-1)/9;
    L:= isqrt(Ls);
    if L^2 > Ls then L:= L-1 fi;
    U:= isqrt(Us);
    if U^2 < Us then U:= U+1 fi;
    if L > U then res
    else res, procname(10*r+a,a,b,m-1), procname(10*r+b,a,b,m-1)
    fi
    end proc:
    S2:= {seq(i^2 mod 100, i=0..99)}:
    prs:= map(t -> `if`(t < 10, {0,t},{(t mod 10),(t - (t mod 10))/10}), S2):
    prs:= map(p -> `if`(nops(p)=1, seq(p union {s},s={$0..9} minus p), p), prs):
    Res:= NULL:
    for p in prs do
      a:= min(p); b:= max(p);
      if a > 0 then
         Res:= Res, F(a,a,b,14);
      fi;
      Res:= Res, F(b,a,b,14);
    od:
    sort(convert({0,Res},list)); # Robert Israel, Dec 03 2015
  • Mathematica
    Select[Range[0, 10^5]^2, Length@ Union@ IntegerDigits@ # <= 2 &] (* Michael De Vlieger, Dec 03 2015 *)
    Select[Range[0,100000]^2,Count[DigitCount[#],0]>7&] (* Harvey P. Dale, Jul 25 2020 *)
  • PARI
    for (n=0, 10^6, if ( #Set(digits(n^2))<=2, print1(n^2, ", ") ) ); \\ Michel Marcus, May 21 2015

Formula

For n > 4, a(n) = A016069(n-4)^2.

Extensions

0 inserted and definition edited by Jon E. Schoenfield, Jan 15 2014

A016070 Numbers k such that k^2 contains exactly 2 different digits, excluding 10^m, 2*10^m, 3*10^m.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 11, 12, 15, 21, 22, 26, 38, 88, 109, 173, 212, 235, 264, 3114, 81619
Offset: 1

Views

Author

Keywords

Comments

No other terms below 3.16*10^20 (derived from A018884).

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 109, p. 38, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Number Theory, F24.

Crossrefs

Programs

  • Mathematica
    Select[Range[100000],Length[DeleteCases[DigitCount[#^2],0]]==2 && !Divisible[ #,10]&] (* Harvey P. Dale, Aug 15 2013 *)
    Reap[For[n = 4, n < 10^5, n++, id = IntegerDigits[n^2]; If[FreeQ[id, {, 0 ...}], If[Length[Union[id]] == 2, Sow[n]]]]][[2, 1]] (* _Jean-François Alcover, Sep 30 2016 *)
  • Python
    from gmpy2 import is_square, isqrt
    from itertools import combinations, product
    A016070_list = []
    for g in range(2,20):
        n = 2**g-1
        for x in combinations('0123456789',2):
            if not x in [('0','1'), ('0','4'), ('0','9')]:
                for i,y in enumerate(product(x,repeat=g)):
                    if i > 0 and i < n and y[0] != '0':
                        z = int(''.join(y))
                        if is_square(z):
                            A016070_list.append(isqrt(z))
    A016070_list = sorted(A016070_list) # Chai Wah Wu, Nov 03 2014

Formula

A043537(a(n)) = 2. [Reinhard Zumkeller, Aug 05 2010]

A378492 Squares where larger digits have larger multiplicity.

Original entry on oeis.org

0, 1, 4, 9, 144, 441, 1444, 29929, 55225, 166464, 255025, 299209, 633616, 646416, 767376, 4999696, 9696996, 34433424, 228281881, 414041104, 414488881, 424442404, 536663556, 969699600, 1649496996, 1929229929, 2636206336, 2666999449, 2929299129, 2996029696, 4664343616
Offset: 1

Views

Author

Erich Friedman, Nov 28 2024

Keywords

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,S;
       L:= convert(n,base,10);
       S:= Statistics:-Tally(L,output=list);
       S:= sort(S, (a,b) -> lhs(a) < lhs(b));
       andmap(t -> rhs(S[t])Robert Israel, Nov 29 2024
  • Mathematica
    increasingQ[L_]:=Min[Rest[(L-RotateRight[L])]]>0;
    sortedQ[n_]:=increasingQ[Sort[Tally[IntegerDigits[n]]][[All,2]]]
    Select[Range[575000000]^2,sortedQ]

A378498 Squares where larger digits have smaller multiplicity.

Original entry on oeis.org

1, 4, 9, 100, 121, 225, 400, 484, 676, 900, 10000, 11881, 40000, 44944, 69696, 90000, 111556, 202500, 220900, 225625, 232324, 261121, 265225, 300304, 442225, 444889, 695556, 1000000, 1002001, 1020100, 1210000, 2250000, 2295225, 4000000, 4008004, 4080400, 4840000, 5112121, 6760000, 8008900, 9000000
Offset: 1

Views

Author

Erich Friedman, Nov 28 2024

Keywords

Comments

Conjecture: a(n) ≍ n^2. - Charles R Greathouse IV, Nov 29 2024

Crossrefs

Programs

  • Mathematica
    decreasingQ[L_]:=Max[Rest[(L-RotateRight[L])]]<0;
    sortedQ[n_]:=decreasingQ[Sort[Tally[IntegerDigits[n]]][[All,2]]];
    Select[Range[10000]^2, sortedQ]
  • PARI
    has(n)=my(d=matreduce(digits(n))[,2]); for(i=2,#d, if(d[i]>=d[i-1], return(0))); 1
    list(lim)=my(v=List()); for(n=1,sqrtint(lim\1), if(has(n^2), listput(v,n^2))); Vec(v) \\ Charles R Greathouse IV, Nov 29 2024

Formula

n^2 << a(n) << 1.001^n. - Charles R Greathouse IV, Nov 29 2024

A385175 Cubes using at most three distinct digits, not ending in 0.

Original entry on oeis.org

1, 8, 27, 64, 125, 216, 343, 512, 729, 1331, 2744, 3375, 46656, 238328, 778688, 1030301, 5177717, 7077888, 9393931, 700227072, 1003003001, 44474744007, 1000300030001, 1000030000300001, 1331399339931331, 3163316636166336, 1000003000003000001, 1000000300000030000001, 1000000030000000300000001
Offset: 1

Views

Author

Gonzalo Martínez, Jun 20 2025

Keywords

Comments

This sequence has infinitely many terms since (10^m + 1)^3 is a term for all m >= 0.
Conjecture: a(26) = 3163316636166336 is the largest term with nonzero digits (See comments of A030294 and the data of A155146, where a(26) = A155146(47)^3).

Examples

			8, 343, and 46656 belong to this list because they are cubes that use 1, 2, and 3 distinct digits, respectively.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6]^3,Length[Union[IntegerDigits[#]]]<4&&IntegerDigits[#][[-1]]!=0&] (* James C. McMahon, Jun 30 2025 *)
    fQ[n_] := Mod[n, 10] > 0 && Length@ Union@ IntegerDigits[n^3] < 4; k = 1; lst = {}; While[k < 1000002, If[ fQ@k, AppendTo[lst, k]]; k++]; lst^3 (* Robert G. Wilson v, Jul 10 2025 *)

Formula

a(n) = A202940(n)^3.

Extensions

a(28) from Robert G. Wilson v, Jul 10 2025
a(29) from David A. Corneth, Jul 10 2025
Showing 1-6 of 6 results.