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.

A378048 Numbers k such that k and k^2 together use at most 4 distinct decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 25, 26, 27, 28, 30, 31, 35, 38, 40, 41, 45, 46, 50, 55, 56, 60, 63, 64, 65, 66, 68, 70, 74, 75, 76, 77, 80, 81, 83, 85, 88, 90, 91, 95, 96, 97, 99, 100, 101, 102, 105, 109, 110
Offset: 1

Views

Author

Jovan Radenkovicc, Nov 15 2024

Keywords

Comments

Problem: Is there a real constant c such that a(n) < n^c for all positive integers n?
All of A136808, A136809, A136816, ..., A137079 are subsequences. Many if not most terms of A058411, A058413, ... ("tridigital solutions") are also in this sequence; see also Hisanori Mishima's web page for some nontrivial solutions. - M. F. Hasler, Feb 02 2025

Examples

			816 is in the sequence since 816^2 = 665856 and both together use at most 4 distinct digits.
149 is not in the sequence since 149^2 = 22201 and both together use 5 distinct digits.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..1000000] | #Set(Intseq(n)) le 4 and #Set(Intseq(n) cat Intseq(n^2)) le 4];
    
  • Mathematica
    Select[Range[0, 110], Length[Union @@ IntegerDigits@ {#, #^2}] < 5 &] (* Amiram Eldar, Nov 15 2024 *)
  • PARI
    isok(k) = #Set(concat(digits(k), digits(k^2))) <= 4; \\ Michel Marcus, Nov 15 2024
    
  • PARI
    is(n)=my(s=Set(digits(n))); #s<5 && #setunion(Set(digits(n^2)),s)<5 \\ Charles R Greathouse IV, Jan 30 2025
    
  • PARI
    is1(n)=#setunion(Set(digits(n^2)),Set(digits(n)))<5
    ok(m)=my(d=concat(apply(k->digits(lift(k)), [m,m^2]))
    test(d)=my(v=List(),D=10^d); for(n=0,D-1, if(ok(Mod(n,D)), listput(v,n))); Vec(v)
    res=test(8); \\ build a list of residues mod 10^8
    D=diff(concat(res,res[1]+10^8)); #D
    u=List(); for(n=0,10^7, if(is1(n) && !setsearch(n,res), listput(u,n))); \\ build exceptions
    setminus(select(is1,[0..n]),list(n))
    list(lim)=my(v=List(u)); forstep(n=0,lim,D, if(is1(n), listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Jan 30 2025
    
  • Python
    def ok(n): return len(set(str(n)+str(n**2))) <= 4
    print([k for k in range(111) if ok(k)]) # Michael S. Branicky, Nov 18 2024

Formula

A043537(A053061(a(n))) <= 4.
Trivially, a(n) >> n^1.66... where the exponent is log(10)/log(4) (A154155). - Charles R Greathouse IV, Jan 30 2025