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 10 results.

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)).

A090455 Difference between numbers of binary 1's of n and binary 1's of n-th prime.

Original entry on oeis.org

0, -1, 0, -2, -1, -1, 1, -2, -2, -2, -2, -1, 0, -1, -1, -3, -3, -3, 0, -2, 0, -2, 0, -2, 0, -1, -1, -2, -1, 0, -2, -2, -1, -2, -1, -3, -2, -1, -1, -3, -2, -2, -3, 0, 0, -1, 0, -5, -2, -2, -1, -4, -1, -3, 3, -1, 0, -1, 1, 0, 0, 1, 1, -5, -3, -4, -2, -2, -3, -3, 0, -4, -4, -3
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DigitCount[n,2,1]-DigitCount[Prime[n],2,1],{n,80}] (* Harvey P. Dale, Aug 08 2013 *)

Formula

a(n) = A000120(n) - A014499(n);
a(A071600(n)) = a(A049084(A072439(n))) = 0.
a(A049084(A090456(n))) < 0.
a(A049084(A090457(n))) > 0.

Extensions

Definition clarified by Harvey P. Dale, Aug 08 2013

A072580 a(n) = A000040(A072577(n)).

Original entry on oeis.org

11, 13, 71, 79, 89, 107, 127, 131, 139, 157, 179, 181, 227, 229, 331, 337, 419, 421, 433, 457, 461, 487, 491, 787, 797, 809, 811, 821, 823, 853, 877, 919, 977, 1163, 1181, 1213, 1223, 1231, 1277, 1279, 1459, 1487, 1523, 1667, 1697, 1733, 1741, 1861, 1867
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Examples

			In binary representation 20 and A000040(20) = 71 have three 0's: 13 = '10100' and 71 = '1000111', therefore 71 is a term.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 300}, Select[Transpose[{Range[m], Prime[Range[m]]}], Equal @@ DigitCount[#, 2, 0] &]][[;; , 2]] (* Amiram Eldar, Jul 27 2025 *)

Formula

A023416(a(n)) = A023416(A072577(n)) = A035103(n).

A072581 a(n) = A000040(A072578(n)).

Original entry on oeis.org

19, 53, 139, 193, 311, 313, 409, 577, 641, 719, 787, 809, 1033, 1061, 1097, 1171, 1193, 1289, 1627, 1637, 1657, 1669, 1693, 1699, 1747, 1811, 1877, 1889, 2083, 2089, 2153, 2161, 2179, 2203, 2213, 2273, 2311, 2659, 2689, 2753, 3169, 3677, 3727, 3733
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Examples

			In binary representation 80 = '1010000' has five 0's and A000040(80) = 409 = '110011001' has five 1's: therefore 409 is a term.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 600}, Select[Transpose[{Range[m], Prime[Range[m]]}], DigitCount[First[#], 2, 0] == DigitCount[Last[#], 2, 1] &]][[;; , 2]] (* Amiram Eldar, Jul 28 2025 *)

Formula

A000120(a(n)) = A023416(A072578(n)) = A014499(n).

A072582 a(n) = A000040(A072579(n)).

Original entry on oeis.org

2, 17, 41, 101, 157, 179, 181, 197, 227, 229, 271, 277, 293, 347, 349, 373, 397, 401, 449, 563, 571, 587, 601, 619, 647, 661, 757, 797, 811, 821, 829, 853, 929, 947, 953, 971, 977, 997, 1039, 1103, 1129, 1213, 1231, 1237, 1303, 1307, 1409, 1433, 1459
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Examples

			In binary representation 70 = '1000110' has three 1's and A000040(70) = 349 = '101011101' has three 1's: therefore 349 is a term.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 300}, Select[Transpose[{Range[m], Prime[Range[m]]}], DigitCount[First[#], 2, 1] == DigitCount[Last[#], 2, 0] &]][[;; , 2]] (* Amiram Eldar, Jul 28 2025 *)

Formula

A023416(a(n)) = A000120(A072579(n)) = A035103(n).

A072584 a(n) = A000040(A072583(n)).

Original entry on oeis.org

3, 7, 23, 29, 31, 37, 43, 47, 59, 61, 103, 109, 137, 149, 151, 163, 167, 173, 191, 199, 223, 233, 239, 241, 251, 257, 263, 307, 317, 359, 367, 379, 383, 431, 439, 443, 463, 467, 479, 499, 503, 509, 541, 557, 569, 599, 607, 613, 617, 631, 643, 653, 659, 673
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Crossrefs

Programs

  • Mathematica
    With[{m = 120}, Select[Transpose[{Range[m], Prime[Range[m]]}], Intersection @@ DigitCount[#, 2] == {} &]][[;; , 2]] (* Amiram Eldar, Jul 28 2025 *)

A090456 Primes prime(k) having more binary 1's than k.

Original entry on oeis.org

3, 7, 11, 13, 19, 23, 29, 31, 37, 43, 47, 53, 59, 61, 71, 79, 89, 101, 103, 107, 109, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 199, 223, 227, 229, 233, 239, 241, 251, 263, 271, 311, 313, 317, 331, 337, 347, 349, 359, 367, 373, 379, 383
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[100]], Differences[DigitCount[{PrimePi[#], #}, 2, 1]][[1]] > 0 &] (* Amiram Eldar, Apr 23 2022 *)

Formula

A090455(a(n)) < 0.

A090457 Primes prime(k) having fewer binary 1's than k.

Original entry on oeis.org

17, 257, 277, 293, 307, 401, 449, 577, 641, 643, 653, 673, 677, 709, 1031, 1033, 1039, 1091, 1093, 1129, 1153, 1217, 1297, 1409, 1543, 1553, 1601, 1607, 1609, 1613, 2053, 2063, 2081, 2083, 2087, 2089, 2099, 2113, 2179, 2309, 2341, 2371, 2593, 2609, 2633, 2647
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    seq[len_] := Module[{s = {}, p = 2, k = 1, c = 0}, While[c < len, If[Greater @@ DigitCount[{k, p}, 2, 1], c++; AppendTo[s, p]]; k++; p = NextPrime[p]]; s]; seq[50] (* Amiram Eldar, Jul 18 2023 *)
    Prime[#]&/@Select[Range[500],DigitCount[#,2,1]>DigitCount[Prime[#],2,1]&] (* Harvey P. Dale, Apr 19 2024 *)
  • PARI
    isok(k) = hammingweight(prime(k)) < hammingweight(k);
    lista(nn) = for(n=1, nn, if (isok(n), print1(prime(n), ", "))); \\ Michel Marcus, Feb 05 2016

Formula

A090455(a(n)) > 0.

A345335 Primes p such that A014499(k) / A000120(k) is an integer, where k = A000720(p).

Original entry on oeis.org

2, 3, 5, 7, 19, 23, 29, 41, 53, 67, 71, 73, 83, 89, 97, 113, 131, 139, 193, 197, 211, 269, 281, 283, 311, 317, 337, 347, 349, 353, 359, 373, 389, 479, 503, 521, 523, 547, 563, 587, 593, 601, 647, 661, 691, 719, 739, 839, 857, 863, 881, 887, 929, 937, 983, 1013
Offset: 1

Views

Author

Ctibor O. Zizka, Jun 14 2021

Keywords

Comments

A014499(k) / A000120(k) = 1 gives A072439.

Examples

			prime(8) = 19, A014499(8)/A000120(8) = 3, thus 19 is a term.
		

Crossrefs

Programs

  • Maple
    R:= NULL: p:= 1: count:= 0:
    for n from 1 while count < 100 do
      p:= nextprime(p);
      if convert(convert(p,base,2),`+`) mod convert(convert(n,base,2),`+`) = 0 then R:= R,p; count:= count+1 fi;
    od:
    R; # Robert Israel, Apr 21 2025
  • Mathematica
    Select[Range[1000], PrimeQ[#] && Divisible @@ DigitCount[{#, PrimePi[#]}, 2, 1] &] (* Amiram Eldar, Jun 14 2021 *)
  • PARI
    isok(p) = isprime(p) && ((hammingweight(p) % hammingweight(primepi(p))) == 0); \\ Michel Marcus, Jun 14 2021
Showing 1-10 of 10 results.