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 92 results. Next

A133223 Sum of digits of primes (A007605), sorted and with duplicates removed.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103
Offset: 1

Views

Author

Lekraj Beedassy, Dec 19 2007

Keywords

Comments

Presumably this is 3 together with numbers greater than 1 and not divisible by 3 (see A001651). - Charles R Greathouse IV, Jul 17 2013. (This is not a theorem because we do not know if, given s > 3 and not a multiple of 3, there is always a prime with digit-sum s. Cf. A067180, A067523. - N. J. A. Sloane, Nov 02 2018)
From Chai Wah Wu, Nov 04 2018: (Start)
Conjecture: for s > 10 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 2 and 3 (cf. A137269). This conjecture has been verified for s <= 2995.
Conjecture: for s > 18 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 3 and 4. This conjecture has been verified for s <= 1345.
Conjecture: for s > 90 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 8 and 9. This conjecture has been verified for s <= 8995.
Conjecture: for 0 < a < b < 10, gcd(a, b) = 1 and ab not a multiple of 10, if s > 90 and s is not a multiple of 3, then there exists a prime with digit-sum s consisting only of the digits a and b. (End)

Crossrefs

Extensions

Corrected by Jeremy Gardiner, Feb 09 2014

A067954 Primes related to the nondecreasing subsequence of A007605 (sums of digits of primes).

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 29, 47, 59, 79, 89, 179, 197, 199, 379, 389, 479, 499, 599, 797, 887, 977, 997, 1699, 1789, 1879, 1889, 1979, 1997, 1999, 2999, 3989, 4799, 4889, 4999, 6899, 8699, 8969, 8999, 18899, 19889, 19979, 19997
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 10 2002

Keywords

Comments

a(1)=2; a(n+1) is the smallest prime with sum of digits >= sum of digits of a(n).

Crossrefs

Programs

  • Mathematica
    t = {s = 2}; Do[If[(y = Total[IntegerDigits[x = Prime[n]]]) >= s, AppendTo[t, x]; s = y], {n, 2, 2500}]; t (* Jayanta Basu, Aug 10 2013 *)

A117460 Primes prime(i) such that their sum-of-index-digits A007953(i) and their sum-of-digits A007605(i) are consecutive primes.

Original entry on oeis.org

2, 3, 5, 43, 113, 191, 373, 821, 1097, 1307, 1493, 1523, 1619, 1873, 1907, 2029, 2081, 2339, 3109, 3169, 3347, 3923, 4339, 4421, 4463, 4603, 5417, 5581, 6067, 6263, 6427, 6607, 6791, 6841, 6863, 7127, 7307, 7673, 7723, 7877, 8731, 9341, 10079, 10723
Offset: 1

Views

Author

Enoch Haga, Mar 18 2006

Keywords

Comments

We select primes such that their sum-of-digits is some prime(j) and such that in addition the sum-of-digits of their index is prime(j-1).
Line 160 of the UBASIC program can be altered for <, >, or = relationships
Subset of A046704 - R. J. Mathar, Apr 17 2009

Examples

			"SOD" = "sum of digits": a(5) = 113, the prime whose index is 30. SOD(30) = 3 and SOD(113) = 5. Since 3 < 5 and 5 is nextprime to 3, adjoin 113 to the sequence.
		

Crossrefs

Programs

  • UBASIC
    10 'use of str,mid,len,val 20 'in SOD prime index and SOD prime 30 Y=1 40 Y=nxtprm(Y) 50 C=C+1:print C;Y;"-"; 60 D=str(C):Z=str(Y) 70 E=len(D):F=len(Z) 80 for Q=2 to E 90 A=mid(D,Q,1):G=val(A) 100 I=I+G:print I; 110 next Q 120 for R=2 to F 130 B=mid(Z,R,1):H=val(B) 140 J=J+H:print J; 150 next R 160 if I=prmdiv(I) and J=prmdiv(J) and I>J and I=nxtprm(J) then stop 170 I=0:J=0 180 goto 40

Formula

{A000040(i): A007605(i) = A000040(j) and A007953(i) = A000040(j+1) for some j}. - R. J. Mathar, Apr 17 2009

Extensions

Edited by R. J. Mathar, Apr 17 2009

A154313 Numbers n such that abs(A007605(n) - A007953(n)) < 2.

Original entry on oeis.org

1, 2, 7, 13, 16, 29, 32, 38, 53, 54, 56, 63, 66, 68, 69, 76, 88, 94, 126, 156, 175, 176, 182, 183, 191, 192, 212, 213, 218, 227, 248, 252, 255, 258, 259, 280, 282, 286, 291, 293, 294, 295, 298, 306, 307, 321, 323, 324, 325, 326, 331, 334, 335, 338, 345, 348
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 07 2009

Keywords

Comments

Also, numbers n such that abs(A090431(n)) < 2. - Omar E. Pol, Jan 12 2009

Examples

			If n = 16 then prime(n) = 53 and abs((5+3)-(1+6)) = 8-7 = 1, so 16 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500], Abs[Apply[Plus, RealDigits[Prime[#]][[1]]] - Sum[DigitCount[#][[i]]*i, {i, 9}]] < 2 &] (* G. C. Greubel, Sep 10 2016 *)
  • PARI
    list(lim)=my(v=List(),n); forprime(p=2,, if(n++>lim,break); if(abs(sumdigits(n)-sumdigits(p))<2, listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Sep 10 2016

Extensions

Corrected and edited by Omar E. Pol, Jan 12 2009

A301378 a(n) = 10*A007605(n) - 9*A007652(n).

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 11, 13, 17, 19, 23, 37, 41, 47, 49, 59, 61, 67, 73, 77, 83, 89, 91, 101, 103, 107, 109, 31, 43, 47, 49, 53, 59, 61, 71, 77, 83, 89, 91, 97, 101, 103, 113, 37, 41, 43, 47, 61
Offset: 1

Views

Author

Edmund Algeo, Mar 19 2018

Keywords

Comments

Equivalently, a(n) is the sum of all but the last digit of the n-th prime, concatenated with that last digit.
It appears that as the prime number xyzd transformed by (x+y+z)*10 +d; the larger the prime the less frequent the result is prime....

Examples

			For p=1571 (prime), 1+5+7 = 13; 13*10 = 130; 130+1 = 131 (prime).
		

Crossrefs

Programs

  • Maple
    map(t -> 10*convert(convert(t,base,10),`+`)-9*(t mod 10), [seq(ithprime(i),i=1..100)]); # Robert Israel, Mar 25 2018
  • Mathematica
    Array[10 Total@ # - 9 Last@ # &@ IntegerDigits[Prime@ #] &, 67] (* Michael De Vlieger, Apr 27 2018 *)
  • PARI
    a(n) = my(p=prime(n); d=p % 10); sumdigits(p-d)*10+d; \\ Michel Marcus, Mar 23 2018

Formula

Let ...xyzd represent the decimal expansion of prime(n); then a(n) = (... + x + y + z)*10 + d.
a(n) = 10*A007605(n) - 9*A007652(n). - Robert Israel, Mar 25 2018

A038194 Iterated sum-of-digits of n-th prime; or digital root of n-th prime; or n-th prime modulo 9.

Original entry on oeis.org

2, 3, 5, 7, 2, 4, 8, 1, 5, 2, 4, 1, 5, 7, 2, 8, 5, 7, 4, 8, 1, 7, 2, 8, 7, 2, 4, 8, 1, 5, 1, 5, 2, 4, 5, 7, 4, 1, 5, 2, 8, 1, 2, 4, 8, 1, 4, 7, 2, 4, 8, 5, 7, 8, 5, 2, 8, 1, 7, 2, 4, 5, 1, 5, 7, 2, 7, 4, 5, 7, 2, 8, 7, 4, 1, 5, 2, 1, 5, 4, 5, 7, 8, 1, 7, 2, 8
Offset: 1

Views

Author

Den Roussel (DenRoussel(AT)webtv.net) and Clark Kimberling

Keywords

Comments

Integers with iterated sum-of-digits 3, 6 or 9 are divisible by 3, so 3 is the only prime with iterated sum-of-digits 3 and there are no primes with iterated sum-of-digits 6 or 9.
The remaining values are very evenly distributed: these are the number of appearances in the first 1007933 primes: 1:167878; 2:168079; 4:167984; 5:168027; 7:167906; 8:168058. - Carmine Suriano, Jun 22 2015
Asymptotically, the ratios (number of primes <= n and == i mod 9)/(number of primes <= n and == j mod 9) go to 1 as n -> infinity for all i,j in {1,2,4,5,7,8} by the Prime Number Theorem for Arithmetic Progressions. For more detailed analysis, see the Granville-Martin link. - Robert Israel, Jul 08 2015

Examples

			Prime(5) = 11, 1 + 1 = 2 hence a(5) = 2.
a(297)=7 because the 297th prime is 1951 and 1+9+5+1 = 16 -> 1+6 = 7.
		

Crossrefs

Programs

Formula

a(n) = A010888(A000040(n)).
Sum_k={1..n} a(k) ~ (9/2)*n. - Amiram Eldar, Dec 11 2024

Extensions

Edited by Klaus Brockhaus, Feb 16 2002
Edited at the suggestion of R. J. Mathar by N. J. A. Sloane, May 14 2008

A033548 Honaker primes: primes P(k) such that sum of digits of P(k) equals sum of digits of k.

Original entry on oeis.org

131, 263, 457, 1039, 1049, 1091, 1301, 1361, 1433, 1571, 1913, 1933, 2141, 2221, 2273, 2441, 2591, 2663, 2707, 2719, 2729, 2803, 3067, 3137, 3229, 3433, 3559, 3631, 4091, 4153, 4357, 4397, 4703, 4723, 4903, 5009, 5507, 5701, 5711, 5741, 5801, 5843
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

Comments

A090431(A049084(a(n))) = 0.

Examples

			131 is the 32nd prime and sum of digits of both is 5.
		

References

Crossrefs

Programs

  • Haskell
    a033548 n = a033548_list !! (n-1)
    a033548_list = filter ((== 0) . a090431 . a049084) a000040_list
    -- Reinhard Zumkeller, Mar 16 2014
    
  • Maple
    read("transforms") :
    isA033548 := proc(n)
        if isprime(n) and digsum(n) = digsum(numtheory[pi](n)) then
            true ;
        else
            false;
        end if;
    end proc:
    A033548 := proc(n)
        local p, k;
        if n = 1 then
            131;
        else
            p := nextprime(procname(n-1)) ;
            while true  do
                if isA033548(p) then
                    return p;
                end if;
                p := nextprime(p) ;
            end do:
        end if;
    end proc:
    seq(A033548(n),n=1..40) ; # R. J. Mathar, Jul 07 2021
  • Mathematica
    Prime[ Select[ Range[ 2000 ], Apply[ Plus, IntegerDigits[ # ] ] == Apply[ Plus, IntegerDigits[ Prime[ # ] ] ] & ] ] (* Santi Spadaro, Oct 14 2001 *)
    Select[ Prime@ Range@ 5927, Plus @@ IntegerDigits@ # == Plus @@ IntegerDigits@ PrimePi@ # &]  (* Robert G. Wilson v, Jun 07 2009 *)
    nn=800;Transpose[Select[Thread[{Prime[Range[nn]],Range[nn]}],Total[IntegerDigits[First[#]]]== Total[ IntegerDigits[ Last[#]]]&]][[1]] (* Harvey P. Dale, Jun 13 2011 *)
  • PARI
    is(n)=isprime(n) && sumdigits(n)==sumdigits(primepi(n)) \\ Charles R Greathouse IV, Jun 18 2015
    
  • Python
    from sympy.ntheory.factor_ import digits
    from sympy import primepi, primerange
    print([n for n in primerange(1, 5901) if (sum(digits(n)[1:])==sum(digits(primepi(n))[1:]))]) # Indranil Ghosh, Jun 27 2017, after Charles R Greathouse IV

Formula

a(n) = A000040(A033549(n)). - R. J. Mathar, Jul 07 2021

Extensions

More terms from Robert G. Wilson v, Jun 07 2009

A051351 a(n) = a(n-1) + sum of digits of n-th prime.

Original entry on oeis.org

0, 2, 5, 10, 17, 19, 23, 31, 41, 46, 57, 61, 71, 76, 83, 94, 102, 116, 123, 136, 144, 154, 170, 181, 198, 214, 216, 220, 228, 238, 243, 253, 258, 269, 282, 296, 303, 316, 326, 340, 351, 368, 378, 389, 402, 419, 438, 442, 449, 460, 473, 481, 495, 502, 510, 524
Offset: 0

Views

Author

Armand Turpel (armandt(AT)unforgettable.com)

Keywords

Crossrefs

Cf. A007605.

Programs

  • Mathematica
    Table[ Sum[ Apply[ Plus, RealDigits[ Prime[ j ]] [[1]] ], {j, 1, n} ], {n, 1, 100} ]
  • PARI
    a(n) = vecsum(apply(sumdigits, primes(n))); \\ Michel Marcus, Aug 28 2023

Extensions

More terms from Robert G. Wilson v, Nov 18 2000

A033549 Numbers k such that sum of digits of k-th prime equals sum of digits of k.

Original entry on oeis.org

32, 56, 88, 175, 176, 182, 212, 218, 227, 248, 293, 295, 323, 331, 338, 362, 377, 386, 394, 397, 398, 409, 439, 446, 457, 481, 499, 508, 563, 571, 595, 599, 635, 637, 655, 671, 728, 751, 752, 755, 761, 767, 779, 820, 821, 826, 827, 847, 848, 857, 869, 878
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

Comments

A090431(a(n)) = 0, A007953(a(n)) = A007605(a(n)).

Examples

			131 is the 32nd prime and sum of digits of both is 5.
		

References

Crossrefs

Programs

  • Haskell
    a033549 n = a033549_list !! (n-1)
    a033549_list = filter ((== 0) . a090431) [1..]
    -- Reinhard Zumkeller, Mar 16 2014
    
  • Mathematica
    Select[Range[1000],Total[IntegerDigits[#]]==Total[IntegerDigits[ Prime[#]]]&] (* Harvey P. Dale, May 05 2011 *)
  • PARI
    is(n,p=prime(n))=sumdigits(n)==sumdigits(p) \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    from sympy.ntheory.factor_ import digits
    from sympy import prime
    print([n for n in range(1, 1001) if sum(digits(n)[1:])==sum(digits(prime(n))[1:])]) # Indranil Ghosh, Jun 27 2017

A054750 Smallest prime number whose digits sum to n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 29, 67, 89, 199, 599, 2999, 4999, 29989, 59999, 79999, 389999, 989999, 6999899, 8989999, 59899999, 89999999, 289999999, 799999999, 3999998999, 19999997999, 79999999999, 399999998999, 599999899999, 999998999999
Offset: 1

Views

Author

G. L. Honaker, Jr., Apr 24 2000

Keywords

Comments

a(n) >= A051885(A000040(n)). Indices n for which the equality holds are listed in A055019.
a(n) >= A046864(n). - Michel Marcus, Nov 01 2015

Examples

			a(7)=89 because 8+9=17 and 17 is the 7th prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{k=2}, While[DigitSum[k]!=Prime[n], k=NextPrime[k]]; k]; Array[a,15] (* Stefano Spezia, Mar 27 2025 *)
  • PARI
    a(n) = {my(k=2); my(p=prime(n)); while((sumdigits(k) != prime(n)), k=nextprime(k+1)); k;} \\ Michel Marcus, Nov 01 2015

Extensions

More terms from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 31 2000
Edited and extended by Robert G. Wilson v, Feb 26 2002
Showing 1-10 of 92 results. Next