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.

A381851 a(n) is the least number k such that both k and k - s have n prime divisors, counted with multiplicity, where s is the sum of the decimal digits of k.

Original entry on oeis.org

10, 20, 40, 80, 224, 448, 2176, 24640, 98816, 287744, 3771392, 5637632, 6508544, 323903488, 1126252544, 7698939904, 20511260672, 249460531200, 857557762048, 582799458304, 11797582053376, 24614476447744, 591901367468032, 1314105503776768, 5988418763882496
Offset: 2

Views

Author

Robert Israel, May 06 2025

Keywords

Comments

k - s is always divisible by 9, so a(1) does not exist.
a(n) <= A383665(n) if A383665(n) exists.

Examples

			a(4) = 40 because 40 has sum of digits 4, both 40 = 2^3 * 5 and 40 - 4 = 36 = 2^2 * 3^2 have 4 prime divisors, counted with multiplicity, and no number < 40 works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue; local pq, t,x,s,p,i;
          initialize(pq);
          insert([-2^n, 2$n], pq);
          do
            t:= extract(pq);
            x:= -t[1];
            s:= convert(convert(x,base,10),`+`);
            if numtheory:-bigomega(x-s) = n then return x fi;
            p:= nextprime(t[-1]);
            for i from n+1 to 2 by -1 while t[i] = t[-1] do
              insert([t[1]*(p/t[-1])^(n+2-i), op(t[2..i-1]), p$(n+2-i)], pq)
            od;
          od;
    end proc:
    map(f, [$2..21]);
  • PARI
    generate(A, B, n, k) = A=max(A, 2^n); (f(m, p, n) = my(list=List()); if(n==1, forprime(q=max(p, ceil(A/m)), B\m, my(s=sumdigits(m*q)); if(m*q > s && bigomega(m*q-s) == k, listput(list, m*q))), forprime(q=p, sqrtnint(B\m, n), list=concat(list, f(m*q, q, n-1)))); list); vecsort(Vec(f(1, 2, n)));
    a(n) = my(x=2^n, y=2*x); while(1, my(v=generate(x, y, n, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, May 24 2025

Formula

A001222(a(n)) = A001222(A066568(a(n))) = n

Extensions

a(22)-a(23) from Michael S. Branicky, May 07 2025
a(24)-a(26) from Daniel Suteu, May 24 2025