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.

A385494 Total number of 1's in the decimal digits of the divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 2, 1, 3, 2, 2, 3, 2, 1, 3, 1, 2, 2, 2, 2, 3, 1, 3, 2, 1, 1, 3, 1, 2, 3, 2, 1, 2, 3, 2, 2, 1, 1, 4, 2, 2, 2, 2, 2, 3, 1, 2, 1, 3, 2, 3, 1, 1, 2, 2, 3, 2, 1, 3, 2, 2, 1, 4, 2, 1, 1, 3, 1, 4, 3, 1, 2, 1, 2, 3, 1, 2, 3, 3
Offset: 1

Views

Author

Robert Israel, Aug 27 2025

Keywords

Examples

			a(11) = 3 because of the divisors of 11, there is one 1 in 1 and two in 11.
a(60) = 4 because of the divisors of 60, there is one 1 in 1, one in 10, one in 12, one in 15 and none in the other divisors.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d; add(numboccur(1, convert(d,base,10)),d=numtheory:-divisors(n)) end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_]:=Count[IntegerDigits[Divisors[n]]//Flatten,1]; Array[a,100] (* Stefano Spezia, Aug 28 2025 *)
  • PARI
    a(n) = sumdiv(n, d, #select(x->(x==1), digits(d))); \\ Michel Marcus, Aug 28 2025
  • Python
    from sympy import divisors
    def a(n): return sum(str(d).count("1") for d in divisors(n, generator=True))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Aug 27 2025
    

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