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

A387396 a(n) is the smallest positive number with a total of exactly n 2's in the decimal digits of its divisors.

Original entry on oeis.org

1, 2, 12, 22, 72, 84, 168, 264, 252, 756, 504, 672, 1260, 1512, 2184, 2640, 2772, 2016, 2520, 4032, 5544, 5040, 6048, 6720, 7392, 13104, 12096, 16632, 10080, 15120, 18144, 21840, 33600, 25200, 34320, 22176, 20160, 34272, 30240, 42840, 45360, 36960, 50400, 52416, 55440, 94248, 65520, 66528, 60480
Offset: 0

Views

Author

Robert Israel, Aug 28 2025

Keywords

Comments

a(n) is the least number k such that A387394(k) = n.

Examples

			a(3) = 22 because of the divisors of 22, 2 has one 2, 22 has two, for a total of 3, and 22 is the smallest number that works.
		

Crossrefs

Programs

  • Maple
    ff:= proc(n) option remember; numboccur(2, convert(n, base, 10)) end proc:
    f:= proc(n) local d; add(ff(d), d=numtheory:-divisors(n)) end proc:
    V:= Array(0..50): count:= 0:
    for x from 1 while count < 51 do
      v:= f(x); if v <= 50 and V[v] = 0 then V[v]:= x; count:= count+1; fi
    od:
    convert(V,list);
  • Mathematica
    a[n_]:=Module[{k=1}, While[Count[IntegerDigits[Divisors[k]]//Flatten, 2]!=n, k++]; k]; Array[a, 49,0] (* Stefano Spezia, Aug 29 2025 *)
  • PARI
    f(n) = sumdiv(n, d, #select(x->(x==2), digits(d))); \\ A387394
    a(n) = my(k=1); while(f(k) !=n, k++); k; \\ Michel Marcus, Aug 28 2025
    
  • Python
    from itertools import count, islice
    def f(n): return sum(str(d).count("2") for d in divisors(n, generator=True))
    def agen(): # generator of terms
        n, adict = 0, dict()
        for k in count(1):
            v = f(k)
            if v not in adict:
                adict[v] = k
                while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 29 2025

Formula

A387394(a(n)) = n.

A387463 Total number of 3's in the decimal digits of the divisors of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 1, 3, 1, 1, 2, 1, 1, 3, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, 0, 1, 2, 1, 1, 3, 0, 1, 2, 1, 0, 2, 1, 1, 1, 1, 0, 3, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 1, 3, 0, 0, 2, 0, 0, 3
Offset: 1

Views

Author

Robert Israel, Aug 29 2025

Keywords

Examples

			a(33) = 3 because among the divisors of 33, 3 has one 3 and 33 has two, for a total of 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t; add(subs(x=1, t)^3, t = expand((1+x+x^2)^n)) end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_]:=Count[Flatten[IntegerDigits/@Divisors[n]],3];Array[a,99] (* James C. McMahon, Aug 30 2025 *)
  • Python
    from sympy import divisors
    def a(n): return sum(str(d).count("3") for d in divisors(n, generator=True))
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Aug 29 2025
Showing 1-2 of 2 results.