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

A211998 Positions where the monotonicity of A061712 is broken.

Original entry on oeis.org

6, 14, 22, 30, 38, 62, 78, 94, 126, 174, 206, 254, 510, 542, 606, 766, 1022, 1278, 2046
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    (* This script is not convenient for more than 10 terms *) A061712[n_] := A061712[ n] = Module[{m, s, k, p}, For[m=0, True, m++, s = {1, Sequence @@ #, 1} & /@ Permutations[Join[Table[1, {n-2}], Table[0, {m}]]] // Sort; For[k=1, k <= Length[ s], k++, p = FromDigits[s[[k]], 2]; If[PrimeQ[p], Return[p]]]]]; A061712[1] = 2; Reap[Do[If[A061712[n+1] < A061712[n], Print[n]; Sow[n]], {n, 1, 250}]][[2, 1]] (* Jean-François Alcover, Mar 16 2015 *)

Formula

{n: A061712(n+1) < A061712(n)}.

A110700 Number of zeros in the smallest prime with Hamming weight n (given by A061712).

Original entry on oeis.org

1, 0, 0, 1, 0, 3, 0, 1, 1, 1, 1, 1, 0, 3, 1, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 0, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Max Alekseyev, Aug 03 2005

Keywords

Comments

a(n)=0 iff n belongs A000043.
Observe that a(n)=3 for n=6, 14, 30, 62, 126, 254, 510, 1022, ... which is A000918. Conjecture: a(n) is never greater than 3. - T. D. Noe, Mar 14 2008

Crossrefs

Programs

  • Maple
    with(combstruct); a:=proc(n) local m,is,s,t,r; if n=1 then return 1 fi; r:=+infinity; for m from 0 do is := iterstructs(Combination(n-2+m),size=n-2); while not finished(is) do s := nextstruct(is); t := 2^(n-1+m)+1+add(2^i,i=s); if isprime(t) then return m fi; od; od; return 0; end;
  • Mathematica
    A061712[n_] := A061712[n] = Module[{m, s, k, p}, For[m=0, True, m++, s = {1, Sequence @@ #, 1} & /@ Permutations[Join[Table[1, {n - 2}], Table[0, {m}]]] // Sort; For[k=1, k <= Length[s], k++, p = FromDigits[s[[k]], 2]; If[PrimeQ[p], Return[p]]]]]; A061712[1]=2; Table[DigitCount[A061712[n], 2, 0], {n, 1, 100}] (* Jean-François Alcover, Mar 16 2015 *)

Formula

a(n) = A110699(n) - n.

A110699 Binary length of the smallest prime with Hamming weight n (given by A061712).

Original entry on oeis.org

2, 2, 3, 5, 5, 9, 7, 9, 10, 11, 12, 13, 13, 17, 16, 17, 17, 19, 19, 21, 22, 24, 24, 25, 26, 28, 28, 29, 30, 33, 31, 33, 34, 35, 36, 38, 38, 40, 40, 41, 42, 44, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 56, 57, 59, 59, 60, 61, 61, 65, 64, 65, 66, 67, 68, 69, 70, 72, 72, 73
Offset: 1

Views

Author

Max Alekseyev, Aug 03 2005

Keywords

Comments

a(n)=n iff n belongs to A000043.

Crossrefs

Programs

  • Maple
    with(combstruct); a:=proc(n) local m,is,s,t,r; if n=1 then return 2 fi; r:=+infinity; for m from 0 do is := iterstructs(Combination(n-2+m),size=n-2); while not finished(is) do s := nextstruct(is); t := 2^(n-1+m)+1+add(2^i,i=s); if isprime(t) then return n+m fi; od; od; return 0; end;
  • Mathematica
    A061712[n_] := A061712[n] = Module[{m, s, k, p}, For[m=0, True, m++, s = {1, Sequence @@ #, 1} & /@ Permutations[Join[Table[1, {n-2}], Table[0, {m}]]] // Sort; For[k=1, k <= Length[s], k++, p = FromDigits[s[[k]], 2]; If[PrimeQ[p], Return[p] ]]]]; A061712[1]=2; Table[IntegerDigits[A061712[n], 2] // Length, {n, 1, 100}] (* Jean-François Alcover, Mar 16 2015 *)
  • PARI
    a(n) = {forprime(p=2,, if (hammingweight(p) == n, return(#binary(p))););} \\ Michel Marcus, Mar 16 2015

Formula

a(n) = n + A110700(n).

A177768 Positions of decreases in sequence A061712 (related to Hamming weights of primes).

Original entry on oeis.org

7, 15, 23, 31, 39, 63, 79, 95, 127, 175, 207, 255, 511, 543, 607, 767, 1023, 1279, 2047, 4095, 4423, 5135
Offset: 1

Views

Author

Vladimir Shevelev, May 13 2010

Keywords

Comments

Is the sequence infinite?
All terms listed are of the form == 7 (mod 8). Is there a reason for this phenomenon?
Conjecture: The numbers 2^k-1 for k > 2 are terms. - Chai Wah Wu, Sep 02 2021

Crossrefs

Cf. A061712.

Formula

{n : A061712(n) < A061712(n-1)}.

Extensions

a(20)-a(22) from Chai Wah Wu, Sep 06 2021

A014499 Number of 1's in binary representation of n-th prime.

Original entry on oeis.org

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

Views

Author

Ingemar Assarsjo (ingemar(AT)binomen.se)

Keywords

Comments

a(n) is the rank of prime(n) in the base-2 dominance order on the natural numbers. - Tom Edgar, Mar 25 2014

Examples

			From _M. F. Hasler_, Mar 03 2023: (Start)
a(n) = 1 only for p(n = 1) = 2, the only prime equal to a power of 2.
a(n) = 2 for n in A159611 = A000720(A019434) = {2, 3, 7, 55, 6543} (probably complete), the Fermat primes F[k] = 2^2^k + 1 with k = 0, 1, 2, 3, 4. (On the graph one can distinctly see a(6543) = 2 corresponding to F[4] = 65537.)
a(n) = 3 for n in A000720(A081091) = (4, 5, 6, 8, 12, 13, 19, 21, 25, 32, 33, 44, 98, 106, 116, 136, 174, 191, 310, 313, 319, 565, 568, ...). (End)
		

Crossrefs

Cf. A180024. - Reinhard Zumkeller, Aug 08 2010
Cf. A072084.
Cf. A159611 (indices of 2s), A000720(A081091) (indices of 3s). - M. F. Hasler, Mar 03 2023

Programs

  • Haskell
    a014499 = a000120 . a000040  -- Reinhard Zumkeller, Feb 10 2013
    
  • Magma
    [&+Intseq(NthPrime(n), 2): n in [1..100] ]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 2], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    A014499(n)=hammingweight(prime(n)) \\ M. F. Hasler, Nov 20 2009, updated Mar 03 2023
    
  • Python
    from sympy import prime
    def A014499(n): return prime(n).bit_count() # Chai Wah Wu, Mar 22 2023
  • Sage
    [sum(i.digits(base=2)) for i in primes_first_n(200)] # Tom Edgar, Mar 25 2014
    

Formula

a(n) = A000120(A000040(n)).
a(A049084(A061712(n))) = n. - Reinhard Zumkeller, Feb 10 2013
a(n) = [x^prime(n)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018

A104080 Smallest prime >= 2^n.

Original entry on oeis.org

2, 2, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, 536870923, 1073741827, 2147483659
Offset: 0

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Except initial terms and offset, same as A014210 and A203074.
The opposite (greatest prime <= 2^n) is A014234, indices A007053.
The distance from 2^n is A092131, opposite A013603.
Counting zeros instead of both bits gives A372474, cf. A035103, A211997.
Counting ones instead of both bits gives A372517, cf. A014499, A061712.
For squarefree instead of prime we have A372683, cf. A143658, A372540.
The indices of these prime are given by A372684.

Programs

Formula

a(n) = A014210(n), n <> 1. - R. J. Mathar, Oct 14 2008
Sum_{n >= 0} 1/a(n) = A338475 + 1/6 = 1.4070738... (because 1/6 = 1/2 - 1/3). - Bernard Schott, Nov 01 2020
From Gus Wiseman, Jun 03 2024: (Start)
a(n) = A007918(2^n).
a(n) = 2^n + A092131(n).
a(n) = prime(A372684(n)).
(End)

A372441 Number of binary indices (binary weight) of n minus number of prime indices (bigomega) of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 07 2024

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Crossrefs

Positions of zeros are A071814.
For sum instead of length we have A372428, zeros A372427.
For minimum instead of length we have A372437, zeros {}.
For maximum instead of length we have A372442, zeros A372436.
Positions of odd terms are A372590, even A372591.
A003963 gives product of prime indices.
A019565 gives Heinz number of binary indices, adjoint A048675.
A029837 gives greatest binary index, least A001511.
A048793 lists binary indices, length A000120, reverse A272020, sum A029931.
A061395 gives greatest prime index, least A055396.
A070939 gives length of binary expansion.
A112798 lists prime indices, length A001222, reverse A296150, sum A056239.

Programs

  • Maple
    f:= proc(n) convert(convert(n,base,2),`+`)-numtheory:-bigomega(n) end proc:
    map(f, [$1..100]); # Robert Israel, May 22 2024
  • Mathematica
    bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[bix[n]]-Length[prix[n]],{n,100}]

Formula

a(n) = A000120(n) - A001222(n).

A211997 Smallest prime with at least n 1's when written in binary.

Original entry on oeis.org

2, 3, 7, 23, 31, 127, 127, 383, 991, 2039, 3583, 6143, 8191, 63487, 63487, 129023, 131071, 522239, 524287, 1966079, 4128767, 14680063, 14680063, 33546239, 67108351, 201064447, 260046847, 536739839, 1073479679, 2147483647, 2147483647, 8581545983, 16911433727, 32212254719
Offset: 1

Views

Author

Keywords

Comments

In contrast to the more vague statement in A061712, the existence of every term of this sequence follows from the Sierpinski theorems (see reference, point 28).

References

  • Ernst Trost, Primzahlen, Birkhäuser-Verlag, 1953.

Crossrefs

Formula

a(n) <= A061712(n).

A066195 Smallest prime containing n zeros in its binary expansion.

Original entry on oeis.org

3, 2, 19, 17, 67, 131, 523, 257, 1033, 2053, 4099, 8209, 16417, 32771, 65539, 65537, 262147, 524353, 1048609, 2097169, 4194433, 8388617, 16777729, 67108913, 67239937, 134250497, 268435459, 536903681, 1073741827, 2147483713, 8589934627, 8589934609, 17179869697
Offset: 0

Views

Author

Robert G. Wilson v, Dec 15 2001

Keywords

Comments

A023416(a(n)) = n and A023416(m) <> n for m < A049084(a(m)).

Crossrefs

Cf. A061712.

Programs

  • Haskell
    import Data.List (find)
    import Data.Maybe (fromJust)
    a066195 n = fromJust $ find ((== n) . a023416) a000040_list
    -- Reinhard Zumkeller, Feb 19 2013
  • Mathematica
    Do[ k = 1; While[ Count[ IntegerDigits[ Prime[ k ], 2 ], 0 ] != n, k++ ]; Print[ Prime[ k ] ], {n, 1, 24} ]

Extensions

a(25)-a(32) from Alois P. Heinz, Jun 28 2015

A372437 (Least binary index of n) minus (least prime index of n).

Original entry on oeis.org

1, -1, 2, -2, 1, -3, 3, -1, 1, -4, 2, -5, 1, -1, 4, -6, 1, -7, 2, -1, 1, -8, 3, -2, 1, -1, 2, -9, 1, -10, 5, -1, 1, -2, 2, -11, 1, -1, 3, -12, 1, -13, 2, -1, 1, -14, 4, -3, 1, -1, 2, -15, 1, -2, 3, -1, 1, -16, 2, -17, 1, -1, 6, -2, 1, -18, 2, -1, 1, -19, 3
Offset: 2

Views

Author

Gus Wiseman, May 06 2024

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Is 0 the only integer not appearing in the data?

Crossrefs

Positions of first appearances are A174090.
For sum instead of minimum we have A372428, zeros A372427.
For maximum instead of minimum we have A372442, zeros A372436.
For length instead of minimum we have A372441, zeros A071814.
A003963 gives product of prime indices.
A019565 gives Heinz number of binary indices, adjoint A048675.
A029837 gives greatest binary index, least A001511.
A048793 lists binary indices, length A000120, reverse A272020, sum A029931.
A061395 gives greatest prime index, least A055396.
A070939 gives length of binary expansion.
A112798 lists prime indices, length A001222, reverse A296150, sum A056239.

Programs

  • Mathematica
    bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Min[bix[n]]-Min[prix[n]],{n,2,100}]

Formula

a(2n) = A001511(n).
a(2n + 1) = -A038802(n).
a(n) = A001511(n) - A055396(n).
Showing 1-10 of 40 results. Next