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.

Previous Showing 11-14 of 14 results.

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

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

Original entry on oeis.org

15, 102, 204, 408, 3078, 14496, 88448, 128768, 6857312, 111411968, 844844000, 6059394048, 13384999936, 948305874880, 6373064359936, 186505184249928
Offset: 2

Views

Author

Zak Seidov and Robert Israel, May 04 2025

Keywords

Comments

k - s is always divisible by 9, so a(1) does not exist, and a(2) = 15 is the only semiprime k such that k, k - s and k + s are all semiprimes.

Examples

			a(4) = 204 because 204 has digit sum 6, 204 - 6 = 198 = 2 * 3^2 * 11, 204 = 2^2 * 3 * 17 and 204 + 6 = 210 = 2 * 3 * 5 * 7 all have 4 prime divisors, counted with multiplicity, and 204 is the least number that 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 and 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..14]);
  • 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(bigomega(m*q+s) == k && 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(A062028(a(n))) = A001222(A066568(a(n))) = n.

Extensions

a(15) from Michael S. Branicky, May 08 2025
a(16)-a(17) from Daniel Suteu, May 24 2025

A309417 Number of steps needed to reduce 10^n to zero by subtracting its digital sum.

Original entry on oeis.org

2, 11, 81, 611, 4798, 39320, 333583, 2897573, 25632474, 230231687, 2091437006, 19145032382, 176258021378, 1630867803755, 15161044498785, 141573907590908, 1327916557473475, 12513166293358138, 118472791400037286, 1126683083504083356, 10754171449735292485
Offset: 1

Views

Author

Reiner Moewald, Jul 30 2019

Keywords

Comments

Conjecture: lim_{n->infinity} a(n+1)/a(n) = 10.

Examples

			a(100)=11 since 100->99->81->72->63->54->45->36->27->18->9->0.
		

Crossrefs

Cf. A066568 (n - sum of digits of n).

Programs

  • Mathematica
    f[n_] := Length[NestWhileList[# - Total[IntegerDigits[#]]&, n, # > 0 &]]-1; f /@ (10^Range[8]) (* Amiram Eldar, Aug 08 2019 *)
  • PARI
    a(n)={my(s=10^n, k=0); while(s, k++; s-=sumdigits(s)); k} \\ Andrew Howroyd, Sep 09 2019
  • Python
    import math
    def digitsum(n):
       ds = 0
       while n > 0:
          ds += n % 10
          n = n // 10
       return ds
    def steps(n):
       count = 0
       while n > 0:
          n = n - digitsum(n)
          count += 1
       return count
    n = 1
    for i in range(1,10):
       n = 10 * n
       print(steps(n))
    

Extensions

a(13)-a(15) from Giovanni Resta, Sep 10 2019
a(16) and on from Dominic McCarty, Feb 12 2025

A210524 a(n) = n - sum of even digits of n.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 10, 11, 10, 13, 10, 15, 10, 17, 10, 19, 18, 19, 18, 21, 18, 23, 18, 25, 18, 27, 30, 31, 30, 33, 30, 35, 30, 37, 30, 39, 36, 37, 36, 39, 36, 41, 36, 43, 36, 45, 50, 51, 50, 53, 50, 55, 50, 57, 50, 59, 54, 55, 54, 57, 54, 59, 54, 61
Offset: 0

Views

Author

Marco Piazzalunga, Jan 27 2013

Keywords

Comments

In even positions there are odd terms.
The difference between n and even digits of n and n has odd and even digits gives even terms finishing with 0.

Examples

			a(14) = 14 - 4 = 10.
a(28) = 28 - 2 - 8 = 18.
		

Crossrefs

Cf. A066568.

Programs

  • Mathematica
    Table[n-Total[Select[IntegerDigits[n],EvenQ]],{n,0,90}] (* Harvey P. Dale, May 20 2017 *)
  • PARI
    a(n) = {digs = digits(n, 10); return (n - sum(i=1, #digs, digs[i]*(1 - (digs[i] % 2))));} \\ Michel Marcus, Jul 15 2013

Formula

a(n) ~ n. a(n) = n mod 2. - Charles R Greathouse IV, Jan 28 2013
Previous Showing 11-14 of 14 results.