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

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

A071600 Numbers k such that k and prime(k) have the same number of 1's in their binary representation.

Original entry on oeis.org

1, 3, 13, 19, 21, 23, 25, 30, 44, 45, 47, 57, 60, 61, 71, 77, 98, 99, 101, 103, 107, 108, 110, 118, 121, 125, 158, 159, 178, 179, 184, 186, 187, 188, 209, 215, 218, 221, 237, 244, 246, 247, 248, 249, 251, 279, 287, 312, 334, 335, 346, 350, 359, 361, 362, 365
Offset: 1

Views

Author

Benoit Cloitre, Jun 01 2002

Keywords

Examples

			221 = 11011101 in base 2, prime(221) = 1381 = 10101100101 in base 2, both have 6 "1's" in their binary representation, hence 221 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400],DigitCount[#,2,1]==DigitCount[Prime[#],2,1]&] (* Harvey P. Dale, Mar 09 2015 *)
  • PARI
    for(n=1,1000,s=1; if(sum(i=1,length(binary(n)), component(binary(n),i))==sum(i=1,length(binary(prime(n))), component(binary(prime(n)),i)),print1(n,",")))
    
  • PARI
    is(n)=hammingweight(n)==hammingweight(prime(n)) \\ Charles R Greathouse IV, Mar 07 2013

Formula

a(n) = A049084(A072439(n)); A000120(a(n)) = A000120(A072439(n)). - Reinhard Zumkeller, Jun 17 2002
A090455(a(n)) = 0, A000120(a(n)) = A014499(a(n)).

A090431 Difference between sums of digits of n and n-th prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Comments

a(n) = A007953(n) - A007605(n);
a(A033549(n))=a(A049084(A033548(n)))=0; a(A049084(A090432(n)))<0; a(A049084(A090433(n)))>0.

Crossrefs

Cf. A239324 (partial sums).

Programs

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

A117461 Indices associated with primes in A117460. Both primes and their indices, after calculation of their respective digit sums, bear the relationship that both are prime and that sod(i) < sod(p) and sod(p) is the next prime after to sod(i), where sod is the sum of digits function.

Original entry on oeis.org

1, 2, 3, 14, 30, 43, 74, 142, 184, 214, 238, 241, 256, 287, 292, 308, 313, 346, 443, 449, 472, 544, 593, 601, 607, 623, 715, 737, 791, 814, 836, 854, 874, 881, 883, 913, 931, 973, 980, 995, 1088, 1156, 1237, 1307, 1316, 1343, 1381, 1396, 1462, 1565, 1622
Offset: 0

Views

Author

Enoch Haga, Mar 18 2006

Keywords

Comments

A117458-A117459 is the opposite case where sod(i) > sod(p).
A117460-A117461 is sod(i) < sod(p).
A033548-A033549 is sod(i) = sod(p). - G. L. Honaker, Jr.

Examples

			a(4) = 30. Its associated prime is 113 with sod = 5; sod(a(4)) = 3. Since 3 < 5 and 5 is the next prime after 3, a(4) belongs in the sequence.
		

Crossrefs

Cf. A007953 (sum of digits).

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
    				

Formula

SOD's are calculated for these indices; if they and their associated prime SOD's are both prime and bear the relation in the Brief description above, they are added to the sequence.

A117477 Primes whose SOD and that of their indices are both prime and equal (indices may not be prime, but their SOD must be prime).

Original entry on oeis.org

131, 263, 1039, 1091, 1301, 1361, 1433, 2221, 2441, 2591, 2663, 2719, 2803, 3433, 3631, 4153, 4357, 4397, 5507, 5701, 5741, 5927, 6311, 6353, 6553, 6737, 6827, 6971, 7013, 7213, 7411, 7523, 7741, 8821, 9103, 11173, 11353, 11731, 11821, 12277, 12347
Offset: 1

Views

Author

Enoch Haga, Mar 19 2006

Keywords

Comments

"SOD" = "sum of digits".
This sequence is a subset of A033548, the difference being that this sequence requires prime SODs.

Examples

			a(3) = 1039, the 175th prime. Both the SOD of the index and the prime are prime and equal: 13 = 13.
		

Crossrefs

Programs

  • Mathematica
    sodQ[{n_,p_}]:=Module[{sodn=Total[IntegerDigits[n]],sodp=Total[IntegerDigits[p]]},AllTrue[ {sodn,sodp},PrimeQ] && sodn == sodp]; Select[With[{nn=1500},Table[{n,Prime[n]},{n,nn}]],sodQ][[;;,2]] (* Harvey P. Dale, Apr 20 2024 *)
  • UBASIC
    20 '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 then stop
    170 I=0:J=0
    180 goto 40

Formula

Find primes whose indices, when SODs are computed, are both prime and SOD(i) = SOD(p)

A117478 Indices of associated primes in A117477.

Original entry on oeis.org

32, 56, 175, 182, 212, 218, 227, 331, 362, 377, 386, 397, 409, 481, 508, 571, 595, 599, 728, 751, 755, 779, 821, 827, 847, 869, 878, 896, 902, 922, 940, 953, 982, 1099, 1129, 1354, 1372, 1408, 1417, 1468, 1475, 1507, 1550, 1585, 1648, 1693, 1747, 1772, 1774
Offset: 0

Views

Author

Enoch Haga, Mar 19 2006

Keywords

Comments

A subset of A033548-A033549 but here the SODs must be prime and equal

Examples

			a(3) = 182, with SOD 11. The associated prime is 1091, also SOD 11. SODs must be prime and equal.
		

Crossrefs

Programs

  • UBASIC
    20 '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 then stop
    170 I=0:J=0
    180 goto 40

Formula

Find prime indices with associated primes where both SODs are the same and prime.

Extensions

Typo in comment fixed by Franklin T. Adams-Watters, Dec 03 2009

A259067 Sum of digits of Honaker primes (A033548).

Original entry on oeis.org

5, 11, 16, 13, 14, 11, 5, 11, 11, 14, 14, 16, 8, 7, 14, 11, 17, 17, 16, 19, 20, 13, 16, 14, 16, 13, 22, 13, 14, 13, 19, 23, 14, 16, 16, 14, 17, 13, 14, 17, 14, 20, 23, 10, 11, 16, 17, 19, 20, 20, 23, 23, 23, 11, 13, 20, 13, 20, 17, 19, 10, 19, 13, 14, 16, 20, 10, 10, 13, 10, 13, 10, 13, 13, 19, 17, 13, 11, 14, 14, 14, 22, 16, 19, 20, 16, 20, 19, 20, 19, 20
Offset: 1

Views

Author

Zak Seidov, Jun 18 2015

Keywords

Crossrefs

Programs

  • PARI
    lista(nn) = forprime(p=2, nn, if ((sd=sumdigits(p)) == sumdigits(primepi(p)), print1(sd, ", "));); \\ Michel Marcus, Jun 18 2015
    
  • PARI
    go(lim)=my(v=List(),n,s);forprime(p=2,lim, s=sumdigits(n++); if(sumdigits(p)==s, listput(v,s))); Vec(v) \\ Charles R Greathouse IV, Jun 18 2015

Formula

a(n) = A007953(A033548(n)) = A007953(A033549(n)).

A343139 Numbers k that satisfy the condition digitsum(k) = digitsum(pi(k)) where pi is the prime counting function.

Original entry on oeis.org

15, 27, 51, 63, 120, 130, 131, 142, 153, 164, 208, 218, 230, 242, 252, 262, 263, 274, 305, 318, 327, 338, 348, 360, 370, 381, 392, 413, 424, 435, 446, 456, 457, 702, 712, 722, 732, 805, 860, 901, 912, 922, 932, 1016, 1027, 1038, 1039, 1048, 1049, 1059, 1071, 1080
Offset: 1

Views

Author

K. D. Bajpai, Apr 06 2021

Keywords

Comments

a(7) = 131 is the first prime in this sequence.
A033548 (Honaker primes) is a subsequence of this sequence.

Examples

			153 is a term because the number of primes up to 153 is 36 and 1 + 5 + 3 = 9 = 3 + 6.
435 is a term because number of primes up to 435 is 84 and 4 + 3 + 5 = 12 = 8 + 4.
		

Crossrefs

Programs

  • Mathematica
    fHQ[n_] := Plus @@ IntegerDigits@n == Plus @@ IntegerDigits@PrimePi@n; Select[Range[3000], fHQ[#] &]
  • PARI
    for(n=1, 5000, if(sumdigits(n)==vecsum(digits(primepi(n))), print1(n, ", " )));
    
  • PARI
    upto(n) = { my(q = 2, ulim = nextprime(n), pi = 0, res = List()); forprime(p = 3, ulim, pi++; for(i = q, p-1, if(sumdigits(i) == sumdigits(pi), listput(res, i) ) ); q = p ); res } \\ David A. Corneth, May 26 2021
    
  • Python
    from sympy import primepi
    def sd(n): return sum(map(int, str(n)))
    def ok(n): return sd(n) == sd(primepi(n))
    print(list(filter(ok, range(1, 1081)))) # Michael S. Branicky, May 28 2021

A133608 Numbers n such that the sum of digits of n-th semiprime equals sum of digits of n.

Original entry on oeis.org

5, 6, 19, 40, 41, 42, 70, 71, 85, 89, 128, 148, 149, 166, 199, 246, 257, 271, 285, 327, 339, 346, 448, 449, 469, 484, 566, 592, 605, 617, 634, 643, 644, 676, 682, 694, 710, 713, 719, 740, 748, 751, 752, 753, 782, 793, 794, 797, 798, 815, 890, 901, 905, 961
Offset: 1

Views

Author

Jonathan Vos Post, Dec 27 2007

Keywords

Comments

This is to A033549 as semiprimes A001358 are to primes A000040.

Examples

			a(1) = 5 because semiprime(5) = 14, whose sum of digits is 5, the same as its index as a semiprime.
		

Crossrefs

Programs

  • Mathematica
    a = {}; c = 0; For[n = 4, n < 10000, n++, If[Sum[FactorInteger[n][[i, 2]], {i, 1, Length[FactorInteger[n]]}] == 2, c++; If[Plus @@ IntegerDigits[c] == Plus @@ IntegerDigits[n], AppendTo[a, c]]]]; a (* Stefan Steinerberger, Dec 29 2007 *)
    SemiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] - i + 1, {i, PrimePi@ Sqrt@n}]; SemiPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[SemiPrimePi@a < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; Select[Range@ 1000, fQ@# &] (* Robert G. Wilson v *)
    nn=5000;With[{sp=Select[Range[nn],PrimeOmega[#]==2&]},Select[Range[ Length[sp]], Total[ IntegerDigits[sp[[#]]]] ==Total[ IntegerDigits[#]]&]] (* Harvey P. Dale, Oct 15 2012 *)

Formula

A007953(A001358(a(n))) = A007953(a(n)).

Extensions

Corrected and extended by Stefan Steinerberger and Robert G. Wilson v, Dec 29 2007
Showing 1-10 of 11 results. Next