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-10 of 17 results. Next

A057573 Number of primes in A051351 which have index <= 10^n.

Original entry on oeis.org

1, 7, 25, 122, 934, 7268, 61756, 537324, 4756645
Offset: 0

Views

Author

Robert G. Wilson v, Nov 27 2000

Keywords

Crossrefs

Cf. A051351 and A058049.

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k}, k = n + 1; While[ ! PrimeQ[ k ], k++ ]; k ]; c = d = p = q = 0; Do[ While[ d++; d <= 10^n, q = NextPrime[ q ]; p = p + Apply[ Plus, RealDigits[ q ] [[ 1 ] ]]; If[ PrimeQ[ p ], c++ ]]; d--; Print[ c ], {n, 0, 10} ]

Extensions

Offset corrected by Sean A. Irvine, Jun 17 2022

A095402 Sum of digits of all distinct prime factors of n.

Original entry on oeis.org

0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 2, 5, 4, 9, 8, 2, 8, 5, 10, 7, 10, 4, 5, 5, 5, 6, 3, 9, 11, 10, 4, 2, 5, 10, 12, 5, 10, 12, 7, 7, 5, 12, 7, 4, 8, 7, 11, 5, 7, 7, 11, 6, 8, 5, 7, 9, 13, 13, 14, 10, 7, 6, 10, 2, 9, 7, 13, 10, 8, 14, 8, 5, 10, 12, 8, 12, 9, 9, 16, 7, 3, 7, 11, 12, 13, 9, 14, 4, 17, 10
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n = 1000: prime set = {2, 5}, a[1000] = 7;
n = 255255: prime set={3, 5, 7, 11, 13, 17}, a[255255]= 3+5+7+2+4+8 = 29.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] Table[sdp[w], {w, 1, 150}]
    Table[Total[Flatten[IntegerDigits[First/@FactorInteger[n]]]],{n,1,100}] (Zak Seidov)
  • Python
    from sympy import factorint
    def a(n): return sum(sum(map(int, str(p))) for p in factorint(n))
    print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Dec 12 2023

A071317 a(n) = a(n-1) + sum of digits of n^2.

Original entry on oeis.org

0, 1, 5, 14, 21, 28, 37, 50, 60, 69, 70, 74, 83, 99, 115, 124, 137, 156, 165, 175, 179, 188, 204, 220, 238, 251, 270, 288, 307, 320, 329, 345, 352, 370, 383, 393, 411, 430, 443, 452, 459, 475, 493, 515, 534, 543, 553, 566, 575, 582, 589, 598, 611, 630, 648, 658
Offset: 0

Views

Author

Labos Elemer, May 27 2002

Keywords

References

  • N. Agronomof, Question 4419, L'Intermédiaire des Math. 21 (1914) 147.

Crossrefs

Partial sums of A004159.

Programs

  • Haskell
    a071317 n = a071317_list !! n
    a071317_list = scanl1 (+) a004159_list
    -- Reinhard Zumkeller, Apr 12 2014
    
  • Mathematica
    s=0; Do[s=s+Apply[Plus, IntegerDigits[n^2]]; Print[s], {n, 1, 128}]
    nxt[{n_,a_}]:={n+1,a+Total[IntegerDigits[(n+1)^2]]}; NestList[nxt,{0,0},60][[All,2]] (* Harvey P. Dale, Mar 09 2017 *)
    FoldList[#1 + Total@ IntegerDigits[#2^2] &, 0, Range@ 55] (* Michael De Vlieger, Mar 25 2017 *)
    Accumulate[Plus @@@ IntegerDigits[Range[0, 50]^2]] (* Giovanni Resta, Mar 25 2017 *)
  • Python
    from itertools import count, islice, accumulate
    def A071317_gen(): # generator of terms
        return accumulate(map(lambda n:sum(map(int,str(n**2))),count(0)))
    A071317_list = list(islice(A071317_gen(),20)) # Chai Wah Wu, Mar 15 2023

Extensions

a(0) = 0 prepended by Reinhard Zumkeller, Apr 12 2014

A177275 Primes which are a concatenation of some permutation of the first 5 primes.

Original entry on oeis.org

112573, 115237, 115327, 211573, 235117, 257311, 327511, 352711, 357211, 372511, 511237, 511327, 511723, 521137, 521173, 572311, 711523, 725113, 735211, 751123
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 06 2010

Keywords

Comments

There are 20 terms in the sequence. Each is a 6-digit prime with sum of digits equal to 19 = A051351(5).
For each of the 20 entries we define the index i via prime(i) = a(n), which yields the following 20 pairs of (i, A007953(i)):
(10668,21), (10892,20), (10901,11), (18940,22), (20845,19) HP,
(22622,14), (28208,20), (30192,15), (30538,19) HP, (31709,20),
(42386,23), (42392,20), (42426,18), (43145,17), (43149,21),
(47000,11), (57421,19) HP, (58426,25), (59175,27), (60315,15)
Where prime(i) is in A033548, this is marked as "HP" for "Honaker Prime".

Examples

			a(1) = 11//2//5//7//3 = 112573 = prime(10668).
a(5) = 2//3//5//11//7 = 235117 = prime(20845).
a(20) = 7//5//11//2//3 = 751123 = prime(60315).
		

Crossrefs

Programs

  • Maple
    catL := proc(L) local a,i,dgs ; a := op(1,L) ; for i from 2 to nops(L) do dgs := max(1, 1+ilog10(op(i,L))) ; a := a*10^dgs+op(i,L) ; end do: a ; end proc:
    A177275 := proc() local pL,a,c ; pL := [seq(ithprime(c),c=1..5)] ; a := {} ; for c in combinat[permute](pL) do p := catL(c) ; if isprime(p) then a := a union {p} ; end if; end do: print(sort(a)) ; end proc:
    A177275() ; # R. J. Mathar, May 09 2010

Extensions

Added keyword:base,full. Removed the variable p. - R. J. Mathar and Zak Seidov, May 09 2010

A095403 Sum of digits of n minus the sum of digits of all distinct prime factors of n.

Original entry on oeis.org

1, 0, 0, 2, 0, 1, 0, 6, 6, -6, 0, -2, 0, -4, -2, 5, 0, 4, 0, -5, -7, 0, 0, 1, 2, 2, 6, 1, 0, -7, 0, 3, 1, -3, -4, 4, 0, -1, 5, -3, 0, -6, 0, 4, 1, 3, 0, 7, 6, -2, -5, 1, 0, 4, 3, 2, -1, 0, 0, -4, 0, 2, -1, 8, 2, 5, 0, 4, 7, -7, 0, 4, 0, -1, 4, 1, 5, 6, 0, 1, 6, 3, 0, 0, 0, 5, 1, 12, 0, -1, -1, 4, 5, 0, -1, 10, 0, 8, 13, -6, 0, -10, 0, -1, -9, -3, 0, 4, 0, -7, -10
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=1000: A007953[1000]=1, prime set={2,5}, A095402[1000]=7, a[1000]=1-7=-6
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 150}];b=Table[sdp[w], {w, 1, 150}];b-a

Formula

a[n]=A007953[n]-A095402[n]

A095405 Numbers n such that Sum-of-digits-of-n = Sum-of-digits-of-all-distinct-prime-factors-of-n.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 22, 23, 29, 31, 37, 41, 43, 47, 53, 58, 59, 61, 67, 71, 73, 79, 83, 84, 85, 89, 94, 97, 101, 103, 107, 109, 113, 127, 131, 136, 137, 139, 149, 151, 157, 160, 163, 166, 167, 173, 179, 181, 191, 193, 197, 199, 202, 211, 223, 227, 229, 233, 234
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=85: digit sum=13, prime factor-digit sum=5+1+7=13, so 85 is here.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 256}];b=Table[sdp[w], {w, 1, 150}];b-a; Flatten[Position[Sign[b-a], 0]]
    Select[Range[2,300],Total[Flatten[IntegerDigits/@FactorInteger[#][[All, 1]]]] == Total[IntegerDigits[#]]&] (* Harvey P. Dale, Sep 29 2019 *)

Formula

Solutions to A007953[x]=A095402[x].

A104247 Primes that are the sum of digits of the first k primes for some k.

Original entry on oeis.org

2, 5, 17, 19, 23, 31, 41, 61, 71, 83, 181, 269, 389, 419, 449, 631, 683, 727, 743, 809, 929, 1039, 1061, 1069, 1091, 1277, 1381, 1481, 1567, 1613, 1747, 1873, 1951, 1993, 2039, 2129, 2281, 2297, 2339, 2381, 2549, 2579
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(4)=19 because A058049(4)= 5 and sum of digits of the first 5 primes, 2+3+5+7+(1+1)=19 is prime.
		

Crossrefs

Corresponding n's: A058049. Primes: A000040, sum of digits of primes: A007605.

Programs

  • Python
    from sympy import isprime, nextprime
    def sd(n): return sum(map(int, str(n)))
    def aupto(limit):
        alst, k, p, s = [], 1, 2, 2
        while s <= limit:
            if isprime(s): alst.append(s)
            k += 1; p = nextprime(p); s += sd(p)
        return alst
    print(aupto(2579)) # Michael S. Branicky, Jul 18 2021

Formula

a(n) = A007605(1) + ... + A007605(A058049(n)).

A058049 Numbers k such that the sum of the digits of the first k primes is a prime.

Original entry on oeis.org

1, 2, 4, 5, 6, 7, 8, 11, 12, 14, 23, 33, 43, 45, 48, 64, 69, 72, 73, 77, 87, 94, 95, 96, 98, 110, 118, 124, 130, 133, 140, 148, 152, 154, 157, 162, 171, 174, 178, 181, 196, 200, 201, 206, 210, 212, 219, 232, 241, 244, 253, 257, 267, 269, 272, 277, 299, 304, 306
Offset: 1

Views

Author

Robert G. Wilson v, Nov 18 2000

Keywords

Comments

What is intriguing about this sequence is that the number of primes less than 10^m is of the same magnitude as A006880. Here they begin 7, 25, 122, 934.

Examples

			5 is a term because sum of digits of first 5 primes, 2+3+5+7+(1+1)=19, is prime.
a(5) = 6 because in A051351(6) = 2 + 3 + 5 + 7 + 2 (sum of eleven's digits) + 4 (sum of thirteen's digits) which equals the sum of the digits through the sixth prime = 23 which itself is a prime.
		

Crossrefs

Corresponding primes: A104247. Primes: A000040, sum of digits of primes: A007605.
Cf. A051351.

Programs

  • Mathematica
    s = 0; Do[ s = s + Apply[ Plus, RealDigits[ Prime[ n ]] [[1]] ]; If[ PrimeQ[ s ], Print[ n ] ], {n, 1, 1000} ]
  • PARI
    isok(n) = isprime(sum(k=1, n, sumdigits(prime(k)))); \\ Michel Marcus, Mar 11 2017
    
  • Python
    from sympy import isprime, nextprime
    def sd(n): return sum(map(int, str(n)))
    def aupto(limit):
        alst, k, p, s = [], 1, 2, 2
        while k <= limit:
            if isprime(s): alst.append(k)
            k += 1; p = nextprime(p); s += sd(p)
        return alst
    print(aupto(306)) # Michael S. Branicky, Jul 18 2021

Extensions

Edited by R. J. Mathar, Aug 04 2008

A071121 a(n) = a(n-1) + sum of decimal digits of n^3.

Original entry on oeis.org

1, 9, 18, 28, 36, 45, 55, 63, 81, 82, 90, 108, 127, 144, 162, 181, 198, 216, 244, 252, 270, 289, 306, 324, 343, 369, 396, 415, 441, 450, 478, 504, 531, 550, 576, 603, 622, 648, 675, 685, 711, 738, 766, 792, 810, 838, 855, 873, 901, 909, 927, 946, 981, 1008
Offset: 1

Views

Author

Labos Elemer, May 27 2002

Keywords

References

  • N. Agronomof, Question 4420, L'Intermédiaire des Math. 21 (1914), 147.

Crossrefs

Partial sums of A004164.

Programs

  • Mathematica
    s=0; Do[s=s+Apply[Plus, IntegerDigits[n^3]]; Print[s], {n, 1, 128}]
    nxt[{n_,a_}]:={n+1,a+Total[IntegerDigits[(n+1)^3]]}; NestList[nxt,{1,1},60][[;;,2]] (* Harvey P. Dale, Aug 30 2025 *)

A095404 Numbers n such that Sum-of-digits-of-n > Sum-of-digits-of-all-distinct-prime-factors-of-n.

Original entry on oeis.org

1, 4, 6, 8, 9, 16, 18, 24, 25, 26, 27, 28, 32, 33, 36, 39, 44, 45, 46, 48, 49, 52, 54, 55, 56, 62, 64, 65, 66, 68, 69, 72, 75, 76, 77, 78, 80, 81, 82, 86, 87, 88, 92, 93, 96, 98, 99, 108, 117, 121, 124, 125, 128, 129, 135, 138, 143, 144, 147, 148, 155, 156, 159, 162, 164
Offset: 1

Views

Author

Labos Elemer, Jun 21 2004

Keywords

Examples

			n=24: digit sum=6, prime factor-digit sum=2+3=5, so 24 is here;
n=153: digit sum=9, prime factor-digit sum=3+5+3=11>9, so 153 is here.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] a=Table[sd[w], {w, 1, 256}];b=Table[sdp[w], {w, 1, 150}];b-a; Flatten[Position[Sign[b-a], 1]]

Formula

Solutions to A007953[x]>A095402[x].
Showing 1-10 of 17 results. Next