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

A350119 Record values in A057192, until A350118(n) reaches the smallest prime Sierpiński number and then sequence terminates with a(n) = -1.

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 583, 6393, 9715, 33288, 50011, 126113, 31172165
Offset: 1

Views

Author

Jianing Song, Dec 14 2021

Keywords

Examples

			Let b(p) be the smallest m such that p*2^m + 1 is prime. We have a(1) = b(2) = 0.
The least prime p such that b(p) > 0 is p = 3 with b(3) = 1, so a(2) = 1.
The least prime p such that b(p) > 1 is p = 7 with b(7) = 2, so a(3) = 2.
The least prime p such that b(p) > 2 is p = 17 with b(17) = 3, so a(4) = 3.
The least prime p such that b(p) > 3 is p = 19 with b(19) = 6, so a(5) = 6.
The least prime p such that b(p) > 6 is p = 31 with b(31) = 8, so a(6) = 8.
The least prime p such that b(p) > 8 is p = 47 with b(47) = 583, so a(7) = 583.
		

Crossrefs

Cf. A057192, A350118, A103964, A076336 (Sierpiński numbers).

Programs

  • PARI
    b(p) = for(k=0, oo, if(isprime(p*2^k+1), return(k)))
    list(lim) = if(lim>=2, my(v=[0],r=0); forprime(p=2, lim, if(b(p)>r, r=b(p); v=concat(v,r))); v) \\ gives a(n) for A350118(n) <= lim

Formula

a(n) = A057192(primepi(A350118(n))).

A005277 Nontotients: even numbers k such that phi(m) = k has no solution.

Original entry on oeis.org

14, 26, 34, 38, 50, 62, 68, 74, 76, 86, 90, 94, 98, 114, 118, 122, 124, 134, 142, 146, 152, 154, 158, 170, 174, 182, 186, 188, 194, 202, 206, 214, 218, 230, 234, 236, 242, 244, 246, 248, 254, 258, 266, 274, 278, 284, 286, 290, 298, 302, 304, 308, 314, 318
Offset: 1

Views

Author

Keywords

Comments

If p is prime then the following two statements are true. I. 2p is in the sequence iff 2p+1 is composite (p is not a Sophie Germain prime). II. 4p is in the sequence iff 2p+1 and 4p+1 are composite. - Farideh Firoozbakht, Dec 30 2005
Another subset of nontotients consists of the numbers j^2 + 1 such that j^2 + 2 is composite. These numbers j are given in A106571. Similarly, let b be 3 or a number such that b == 1 (mod 4). For any j > 0 such that b^j + 2 is composite, b^j + 1 is a nontotient. - T. D. Noe, Sep 13 2007
The Firoozbakht comment can be generalized: Observe that if k is a nontotient and 2k+1 is composite, then 2k is also a nontotient. See A057192 and A076336 for a connection to Sierpiński numbers. This shows that 271129*2^j is a nontotient for all j > 0. - T. D. Noe, Sep 13 2007

Examples

			There are no values of m such that phi(m)=14, so 14 is a term of the sequence.
		

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See Table 44 at p. 91.
  • R. K. Guy, Unsolved Problems in Number Theory, B36.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 91.

Crossrefs

See A007617 for all numbers k (odd or even) such that phi(m) = k has no solution.
All even numbers not in A002202. Cf. A000010.

Programs

  • Haskell
    a005277 n = a005277_list !! (n-1)
    a005277_list = filter even a007617_list
    -- Reinhard Zumkeller, Nov 22 2015
    
  • Magma
    [n: n in [2..400 by 2] | #EulerPhiInverse(n) eq 0]; // Marius A. Burtea, Sep 08 2019
  • Maple
    A005277 := n -> if type(n,even) and invphi(n)=[] then n fi: seq(A005277(i),i=1..318); # Peter Luschny, Jun 26 2011
  • Mathematica
    searchMax = 320; phiAnsYldList = Table[0, {searchMax}]; Do[phiAns = EulerPhi[m]; If[phiAns <= searchMax, phiAnsYldList[[phiAns]]++ ], {m, 1, searchMax^2}]; Select[Range[searchMax], EvenQ[ # ] && (phiAnsYldList[[ # ]] == 0) &] (* Alonso del Arte, Sep 07 2004 *)
    totientQ[m_] := Select[ Range[m +1, 2m*Product[(1 - 1/(k*Log[k]))^(-1), {k, 2, DivisorSigma[0, m]}]], EulerPhi[#] == m &, 1] != {}; (* after Jean-François Alcover, May 23 2011 in A002202 *) Select[2 Range@160, ! totientQ@# &] (* Robert G. Wilson v, Mar 20 2023 *)
  • PARI
    is(n)=n%2==0 && !istotient(n) \\ Charles R Greathouse IV, Mar 04 2017
    

Formula

a(n) = 2*A079695(n). - R. J. Mathar, Sep 29 2021
{k: k even and A014197(k) = 0}. - R. J. Mathar, Sep 29 2021

Extensions

More terms from Jud McCranie, Oct 13 2000

A040076 Smallest m >= 0 such that n*2^m + 1 is prime, or -1 if no such m exists.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 3, 0, 6, 1, 1, 0, 1, 2, 2, 1, 2, 0, 1, 0, 8, 3, 1, 2, 1, 0, 2, 5, 1, 0, 1, 0, 2, 1, 2, 0, 583, 1, 2, 1, 1, 0, 1, 1, 4, 1, 2, 0, 5, 0, 4, 7, 1, 2, 1, 0, 2, 1, 1, 0, 3, 0, 2, 1, 1, 4, 3, 0, 2, 3, 1, 0, 1, 2, 4, 1, 2, 0, 1, 1, 8, 7, 2, 582, 1, 0, 2, 1, 1, 0, 3, 0
Offset: 1

Views

Author

Keywords

Comments

Sierpiński showed that a(n) = -1 infinitely often. John Selfridge showed that a(78557) = -1 and it is conjectured that a(n) >= 0 for all n < 78557.
Determining a(131072) = a(2^17) is equivalent to finding the next Fermat prime after F_4 = 2^16 + 1. - Jeppe Stig Nielsen, Jul 27 2019

Examples

			1*(2^0)+1=2 is prime, so a(1)=0;
3*(2^1)+1=5 is prime, so a(3)=1;
For n=7, 7+1 and 7*2+1 are composite, but 7*2^2+1=29 is prime, so a(7)=2.
		

Crossrefs

For the corresponding primes see A050921.
Cf. A033809, A046067 (odd n), A057192 (prime n).

Programs

  • Mathematica
    Do[m = 0; While[ !PrimeQ[n*2^m + 1], m++ ]; Print[m], {n, 1, 110} ]
    sm[n_]:=Module[{k=0},While[!PrimeQ[n 2^k+1],k++];k]; Array[sm,120] (* Harvey P. Dale, Feb 05 2020 *)

A046067 Smallest m such that (2n-1)2^m+1 is prime, or -1 if no such value exists.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 2, 1, 3, 6, 1, 1, 2, 2, 1, 8, 1, 1, 2, 1, 1, 2, 2, 583, 2, 1, 1, 4, 2, 5, 4, 1, 1, 2, 1, 3, 2, 1, 3, 2, 1, 1, 4, 2, 1, 8, 2, 1, 2, 1, 3, 16, 1, 3, 6, 1, 1, 2, 3, 1, 8, 6, 1, 2, 3, 1, 4, 1, 3, 2, 1, 53, 6, 8, 3, 4, 1, 1, 8, 6, 3, 2, 1, 7, 2, 8, 1, 2, 2, 1, 4, 1, 3, 6, 1, 1, 2, 4, 15, 2
Offset: 1

Views

Author

Keywords

Comments

There exist odd integers 2k-1 such that (2k-1)2^n+1 is always composite.
The smallest known example is 78557. Therefore a(39279) = -1.
For the corresponding primes see A057025(n-1), n >= 1, where a 0 will show up if a(n) = -1. - Wolfdieter Lang, Feb 07 2013.
Jaeschke shows that every positive integer appears infinitely often. - Jeppe Stig Nielsen, Jul 06 2020

References

  • Ribenboim, P. The New Book of Prime Number Records. New York: Springer-Verlag, pp. 357-359, 1996.

Crossrefs

Cf. A046068.
Bisection of A040076. Cf. A033809.

Programs

  • Mathematica
    max = 10000 (* this maximum value of m is sufficient up to n = 1000 *); a[n_] := For[m = 1, m <= max, m++, If[PrimeQ[(2n - 1)*2^m + 1], Return[m]]] /. Null -> -1; a[1] = 0; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 08 2012 *)

A058887 Smallest prime p such that (2^n)*p is a nontotient number.

Original entry on oeis.org

3, 7, 17, 19, 19, 19, 31, 31, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47
Offset: 0

Views

Author

Labos Elemer, Jan 08 2001

Keywords

Comments

For n=8,9,...,582, a(n) = 47. Note that A040076(47)=583.
For n=583,584,...,6392, a(n) = 383. Note that A040076(383)=6393.
Subsequent primes are 2897, 3061, 5297, and 7013 (cf. A057192 and A071628). [These are primes p such that the least e such that 2^e*p + 1 is prime sets a new record. - Jianing Song, Dec 14 2021]
Starting with some large N, a(n)=p for all n >= N. This prime p will likely be the first prime Sierpiński number, which is conjectured to be 271129.
In particular, a(n) <= 271129 for all n.
From Jianing Song, Dec 14 2021: (Start)
a(n) is the smallest prime p such that 2^e*p + 1 is composite for all 0 <= e <= n. A proof is given in the a-file below.
a(n) is also the smallest number k such that 2^n*k is a nontotient number (see A181662). (End)

Examples

			For n=1, the initial segment of {2p} sequence is nops(invphi({2p}))={4, 4, 2, 0, 2, 0, 0, 0, 2, 2, ...}, where the position of the first 0 is 4, corresponding to p(4)=7, so a(1)=7.
For n=8 the same initial segment is: {11, 32, 23, 18, 24, 10, 11, 4, 9, 21, 2, 16, 9, 12, 0, 14, 5, 6, 12, ...}, where the first 0 is the 15th, corresponding to p(15)=47, thus a(8)=47.
		

References

  • David Harden, Posting to Sequence Fans Mailing List, Sep 19 2010.
  • J. L. Selfridge, Solution to Problem 4995, Amer. Math. Monthly, 70:1 (1963), page 101.

Crossrefs

Cf. A005277, A007617, A057192, A071628, A076336 (Sierpiński numbers), A000010, A181662.

Programs

  • Mathematica
    Needs["CNT`"]; Table[p=3; While[PhiInverse[p*2^n] != {}, p=NextPrime[p]]; p, {n,0,20}]
  • PARI
    a(n) = my(p=2); while(istotient(2^n*p), p=nextprime(p+1)); p; \\ Michel Marcus, May 14 2020

Formula

Min{p|p is prime and card(invphi((2^n)*p))=0}.
From Jianing Song, Dec 14 2021: (Start)
a(0) = 3;
a(1) = 7;
a(2) = 17;
a(3..5) = 19;
a(6..7) = 31;
a(8..582) = 47;
a(583..6392) = 383;
a(6393..9714) = 2897;
a(9715..33287) = 3061;
a(33288..50010) = 5297;
a(50011..126112) = 7013;
a(126113..31172164) = 10223.
a(n) = A181662(n) / 2^n. (End)

Extensions

Edited by T. D. Noe, Nov 15 2010
Edited by Max Alekseyev, Nov 19 2010

A137715 Prime values of n for which n*2^k + 1 is composite for all positive integers k.

Original entry on oeis.org

271129, 322523, 327739, 482719, 934909, 1639459, 2131043, 2131099, 2576089, 3098059, 3608251, 4573999, 6678713, 6799831, 7523281, 7761437, 8184977, 8840599, 8879993, 8959163, 9208337, 9252323, 9930469, 9937637, 10192733, 10306187, 10391933, 11206501
Offset: 1

Views

Author

Ant King, Feb 09 2008

Keywords

Comments

The sequence contains those members of A076336 that are prime.
Note that the terms in A076336 are presently conjectural. - Joerg Arndt, Jun 29 2015

Examples

			As 271129 is the first known prime value of n for which n*2^k + 1 is composite for all positive integers k, a(1) = 271129.
		

Crossrefs

Extensions

More terms from Arkadiusz Wesolowski, Apr 24 2012

A071628 Smallest m such that (2n-1)*2^m is totient, that is, in A002202, or -1 if (2n-1)*2^m is never a totient.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 3, 6, 1, 1, 2, 1, 1, 8, 1, 1, 2, 1, 1, 2, 2, 583, 2, 1, 1, 1, 2, 5, 4, 1, 1, 2, 1, 3, 2, 1, 3, 2, 1, 1, 4, 2, 1, 4, 2, 1, 2, 1, 3, 16, 1, 3, 6, 1, 1, 2, 2, 1, 4, 2, 1, 2, 3, 1, 4, 1, 3, 2, 1, 3, 2, 1, 3, 4, 1, 1, 8, 2, 3, 2, 1, 7, 2, 1, 1, 2, 2, 1, 4, 1, 3, 4, 1, 1, 2, 2, 15, 2, 3, 2
Offset: 1

Views

Author

Labos Elemer, May 30 2002

Keywords

Comments

When 2n-1 is the k-th prime, then a(n) = A040076(2n-1) = A046067(n) = A057192(k). [This is only partially correct. If 2n-1 = 2^2^m + 1 is a Fermat prime, then a(n) = min{2^m, A040076(2n-1)} if 2n-1 is not a Sierpiński number and a(n) = 2^m otherwise, since phi((2n-1)^2) = (2n-1)*2^m. For example, a(129) = 8 < A040076(257) = 279, a(32769) = 16 < A040076(65537) = 287. - Jianing Song, Dec 14 2021]
From Jianing Song, Dec 14 2021: (Start)
a(1) should have been 0.
If 2n-1 is a prime Sierpiński number which is not a Fermat prime, then a(2n-1) = -1.
Do there exists n such that 2n-1 is composite and that a(2n-1) = -1? It seems very unlikely that this will happen: Let 2n-1 = (a_1)^(e_1) * (a_2)^(e_2) * ... * (a_r)^(e_r) * (q_1)^(f_1) * (q_2)^(f_2) * ... * (q_s)^(f_s), where a_1, a_2, ..., a_r are distinct numbers that are not Fermat primes (a_i is not necessarily a prime), q_1, q_2, ..., q_s are distinct Fermat primes. If p_{i,1}, p_{i,2}, ..., p_{i,e_i} are distinct primes of the form 2^e * (a_i) + 1, then the odd part of phi((Product_{i=1..r, j=1..e_i} p_{i,j}) * (Product_{i=1..s} (q_s)^(1+f_s))) is 2n-1.
Therefore, if k is not a Sierpiński number implies that there are infinitely many e such that 2^e * k + 1 is prime, then a necessary condition for a(2n-1) = -1 is that: for every factorization 2n-1 = (u_1) * (u_2) * ... * (u_t) (u_i is not necessarily a prime, and (u_i)'s are not necessarily distinct), at least one u_i must be a Sierpiński number which is not a Fermat prime. In particular, 2n-1 itself must be a Sierpiński number. (End)

Examples

			n=52:2n-1=13, [seq(nops(invphi(103*2^i)),i=1..25)]; gives: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,6,8,10,12,14,16,18,20]; nonzero appears first at position 16, so a(52)=16,since 6750208=103.2^16 is totient, while 3375104 is nontotient. n=24, 2n-1=47: the first nonempty InvPhi(47.2^i) set arises at i=a[24]=583, a very large number.
		

Crossrefs

Similar to but different from A046067. See also A058887, A057192.
Cf. A000010, A002202, A007617, A076336 (Sierpiński numbers).

Programs

  • Maple
    with(numtheory); [seq(nops(invphi(odd*2^i)),i=1..N)]; Position of first nonzero provides a[n] belonging to 2n-1 odd number.
  • Mathematica
    Needs["CNT`"]; Table[m=1; While[PhiInverse[n*2^m] == {}, m++], {n,1,200,2}]

Formula

a(n)=Min[{x; Card(InvPhi[(2n-1)*(2^x)])>0}]

Extensions

Escape clause added by Jianing Song, Dec 14 2021

A079697 Odd part of A005277(n).

Original entry on oeis.org

7, 13, 17, 19, 25, 31, 17, 37, 19, 43, 45, 47, 49, 57, 59, 61, 31, 67, 71, 73, 19, 77, 79, 85, 87, 91, 93, 47, 97, 101, 103, 107, 109, 115, 117, 59, 121, 61, 123, 31, 127, 129, 133, 137, 139, 71, 143, 145, 149, 151, 19, 77, 157, 159
Offset: 1

Views

Author

Jon Perry, Jan 31 2003

Keywords

Comments

If A057192(k)=-1 then prime(k) appears an infinite number of times in this sequence, otherwise it occurs A057192(k)-1 times. - T. D. Noe, Sep 13 2007

Examples

			A005277(7)=68, therefore a(7)=17
		

Crossrefs

A181662 a(n) is the smallest positive integral multiple of 2^n not in the range of the Euler phi function.

Original entry on oeis.org

3, 14, 68, 152, 304, 608, 1984, 3968, 12032, 24064, 48128, 96256, 192512, 385024, 770048, 1540096, 3080192, 6160384, 12320768, 24641536, 49283072, 98566144, 197132288, 394264576, 788529152, 1577058304, 3154116608, 6308233216, 12616466432, 25232932864, 50465865728, 100931731456
Offset: 0

Views

Author

N. J. A. Sloane, Nov 18 2010

Keywords

Comments

From Jianing Song, Dec 14 2021: (Start)
Let a(n) = 2^n * k, then k must be odd, otherwise a(n)/2 is a totient number, which implies that a(n) is a totient.
Note that 271129 * 2^m is a nontotient for all m (see A058887), so k <= 271129. In fact, let p be smallest prime such that 2^e*p + 1 is composite for all 0 <= e <= n, then k <= p (since 2^n*p is a nontotient).
Actually, k is equal to p. To verify this, it suffices to show that k cannot be an odd composite number < 271129; that is to say, if 2^n * k is a nontotient for an odd composite number < 271129, then there exists k' < k such that 2^n * k' is a nontotient.
The case k < 383 can be easily checked. Let k be an odd composite number in the range (383, 271129), k * 2^n is a nontotient implies n < 2554 unless k = 98431 or 248959 (see the a-file below), then 383 * 2^n is a nontotient (the least n such that 383 * 2^n + 1 is prime is n = 6393). For k = 98431 or 248959, k * 2^n is a nontotient implies n < 7062, then 2897 * 2^n is a nontotient (the least n such that 2897 * 2^n + 1 is prime is n = 9715. (End)

References

  • David Harden, Posting to Sequence Fans Mailing List, Sep 19 2010.

Crossrefs

Formula

a(n) = A058887(n)*2^n.

Extensions

Escape clause removed by Jianing Song, Dec 14 2021

A057247 a(n) is the smallest prime of the form 1 + prime(n)*2^m, with m > 0.

Original entry on oeis.org

5, 7, 11, 29, 23, 53, 137, 1217, 47, 59, 7937, 149, 83, 173
Offset: 1

Views

Author

Labos Elemer, Jan 10 2001

Keywords

Comments

The prime a(15) has 178 decimal digits. [Corrected by Sean A. Irvine, May 27 2022]

Examples

			Sophie-Germain primes are here at n = 1, 2, 3, 5, 9, 10, .. etc. At n = 11, p(11) = 31 and in the sequence of q = 1+31*{2, 4, 8, 16, 32, 64, 128, 256} = {63, 125, 249, 497, 993, 1985, 3969, 7937}, the first prime is 7937, so b(11) = 8, a(11) = 7937.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local p, m, t; p:= ithprime(n);
          for m do t:= 1+p*2^m; if isprime(t) then return t fi od
        end:
    seq(a(n), n=1..15);  # Alois P. Heinz, May 27 2022
  • Mathematica
    a[n_] := (For[pn = Prime[n]; p = 2, p < 3*10^8 (* large enough to compute 50 terms except a(15) *), p = NextPrime[p], m = Log[2, (p-1)/pn]; If[m > 0 && IntegerQ[m], Print["a(", n, ") = ", p]; Return[p]]]; Print["a(", n, ") not found ", p]; 0); Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Nov 08 2016 *)
  • Python
    from sympy import isprime, prime
    def a(n):
        m, pn = 1, prime(n)
        while not isprime(1 + pn*2**m): m += 1
        return 1 + pn*2**m
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, May 27 2022

Formula

a(n) = Min{q|q is prime, p(n) is the n-th prime and q = 1+p(n)*2^b(n)}.

Extensions

Title clarified by Sean A. Irvine, May 27 2022
Showing 1-10 of 11 results. Next