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.

Previous Showing 11-20 of 99 results. Next

A039787 Primes p such that p-1 is squarefree.

Original entry on oeis.org

2, 3, 7, 11, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 131, 139, 167, 179, 191, 211, 223, 227, 239, 263, 283, 311, 331, 347, 359, 367, 383, 419, 431, 439, 443, 463, 467, 479, 499, 503, 547, 563, 571, 587, 599, 607, 619, 643, 647, 659, 683, 691, 719, 743
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition: numbers n such that phi(n) is equal to the squarefree kernel of n-1.
Minimal value of first differences (between odd terms) is 4. - Zak Seidov, Apr 16 2013
The density of this set in A000040 is Artin's constant A = A005596 = 37.39...%, see Mirsky. - Charles R Greathouse IV, Oct 26 2015

Examples

			phi(43)=42, 42=2^1*3^1*7^1, 2*3*7=42.
p=223 is here because p-1=222=2*3*37
		

Crossrefs

Cf. A000010, A007947, A049092 (complement).

Programs

  • Magma
    [p: p in PrimesUpTo(780) | IsSquarefree(p-1)];  // Bruno Berselli, Mar 03 2011
    
  • Maple
    isA039787 := proc(n)
        if isprime(n) then
            numtheory[issqrfree](n-1) ;
        else
            false;
        end if;
    end proc:
    for n from 2 to 100 do
        if isA039787(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Apr 17 2013
    with(numtheory): lis:=[]; for n from 1 to 10000 do if issqrfree(ithprime(n)-1) then lis:=[op(lis), ithprime(n)]; fi; od: lis; # N. J. A. Sloane, Oct 25 2015
  • Mathematica
    Select[Prime[Range[132]],SquareFreeQ[#-1]&](* Zak Seidov, Aug 22 2012 *)
  • PARI
    is(n)=isprime(n) && issquarefree(n-1) \\ Charles R Greathouse IV, Jul 02 2013
    
  • PARI
    forprime(p=2, 1e3, if(issquarefree(p-1), print1(p", "))); \\ Altug Alkan, Oct 26 2015

Extensions

More terms from Labos Elemer

A001609 a(1) = a(2) = 1, a(3) = 4; thereafter a(n) = a(n-1) + a(n-3).

Original entry on oeis.org

1, 1, 4, 5, 6, 10, 15, 21, 31, 46, 67, 98, 144, 211, 309, 453, 664, 973, 1426, 2090, 3063, 4489, 6579, 9642, 14131, 20710, 30352, 44483, 65193, 95545, 140028, 205221, 300766, 440794, 646015, 946781, 1387575, 2033590, 2980371, 4367946, 6401536, 9381907
Offset: 1

Views

Author

Keywords

Comments

This comment covers a family of sequences which satisfy a recurrence of the form a(n) = a(n-1) + a(n-m), with a(n) = 1 for n = 1...m-1, a(m) = m + 1. The generating function is (x + m*x^m)/(1 - x - x^m). Also a(n) = 1 + n*Sum_{i=1..n/m} binomial(n-1-(m-1)*i, i-1)/i. This gives the number of ways to cover (without overlapping) a ring lattice (or necklace) of n sites with molecules that are m sites wide. Special cases: m=2: A000204, m=3: A001609, m=4: A014097, m=5: A058368, m=6: A058367, m=7: A058366, m=8: A058365, m=9: A058364.
The sequence defined by {a(n) - 1} plays a role for the computation of A065414, A146486, A146487, and A146488 equivalent to the role of A001610 for A005596, A146482, A146483 and A146484, see the variable a_{2,n} in arXiv:0903.2514. - R. J. Mathar, Mar 28 2009
Except for n = 2, a(n) is the number of digits in n-th term of A049064. This can be derived form the T. Sillke link below. - Jianing Song, Apr 28 2019

Examples

			G.f. = x + x^2 + 4*x^3 + 5*x^4 + 6*x^5 + 10*x^6 + 15*x^7 + 21*x^8 + ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    I:=[1,1,4]; [n le 3 select I[n] else Self(n-1)+Self(n-3): n in [1..45]]; // Vincenzo Librandi, Jun 28 2015
  • Maple
    A001609:=-(1+3*z**2)/(-1+z+z**3); # Simon Plouffe in his 1992 dissertation
    f:= gfun:-rectoproc({a(n) = a(n-1) + a(n-3), a(1)=1,a(2)=1,a(3)=4},a(n),remember):
    map(f, [$1..100]); # Robert Israel, Jun 29 2015
  • Mathematica
    Table[Tr[MatrixPower[{{0, 0, 1}, {1, 0, 0}, {0, 1, 1}}, n]], {n, 1, 60}] (* Artur Jasinski, Jan 10 2007 *)
    Table[ HypergeometricPFQ[{1/3 - n/3, 2/3 - n/3, -(n/3)}, {1/2 - n/2, 1 - n/2}, -(27/4)], {n, 20}] (* Alexander R. Povolotsky, Nov 21 2008 *)
    a[1] = a[2] = 1; a[3] = 4; m = 3; a[n_] := 1 + n*Sum [Binomial [n - 1 - (m - 1)*i, i - 1]/i, {i, n/m}] A001609 = Table[a[n], {n, 100}] (* Zak Seidov, Nov 21 2008 *)
    LinearRecurrence[{1, 0, 1}, {1, 1, 4}, 50] (* Vincenzo Librandi, Jun 28 2015 *)
  • PARI
    {a(n) = if( n<1, n=-n; polcoeff( (3 + x^2) / (1 + x^2 - x^3) + x * O(x^n), n), polcoeff( x * (1 + 3*x^2) / (1 - x - x^3) + x * O(x^n), n))}; /* Michael Somos, Aug 15 2016 */
    

Formula

G.f.: x*(1 + 3*x^2)/(1 - x - x^3).
a(n) = trace of successive powers of matrix ({{0,0,1},{1,0,0},{0,1,1}})^n. - Artur Jasinski, Jan 10 2007
a(n) = A000930(n) + 3*A000930(n-2). - R. J. Mathar, Nov 16 2007
Logarithmic derivative of Narayana's cows sequence A000930. - Paul D. Hanna, Oct 28 2012
a(n) = w1^n + w2^n + w3^n, where w1,w2,w3 are the roots of the cubic: (-1 - x^2 + x^3), see A092526. - Gerry Martens, Jun 27 2015

Extensions

Additional comments from Yong Kong (ykong(AT)curagen.com), Dec 16 2000
More terms from Michael Somos, Oct 03 2002
Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021

A007351 Where prime race 4m-1 vs. 4m+1 is tied.

Original entry on oeis.org

2, 5, 17, 41, 461, 26833, 26849, 26863, 26881, 26893, 26921, 616769, 616793, 616829, 616843, 616871, 617027, 617257, 617363, 617387, 617411, 617447, 617467, 617473, 617509, 617531, 617579, 617681, 617707, 617719, 618437, 618521, 618593, 618637
Offset: 1

Views

Author

Keywords

Comments

Primes p such that the number of primes <= p of the form 4m-1 is equal to the number of primes <= p of the form 4m+1.
Starting from a(27410)=9103362505753 the sequence includes the 8th sign-changing zone predicted by C. Bays et al. The sequence with the first 8 sign-changing zones contains 419467 terms (see a-file) with a(419467)=9543313015351 as its last term. - Sergei D. Shchebetov, Oct 15 2017

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A156749 Sequence showing Chebyshev bias in prime races (mod 4). [From Daniel Forgues, Mar 26 2009]

Programs

  • Mathematica
    Prime@ Position[Fold[Append[#1, #1[[-1]] + If[Mod[#2, 4] == 3, {1, 0}, {0, 1}]] &, {{0, 0}}, Prime@ Range[2, 10^5]], ?(SameQ @@ # &)][[All, 1]] (* _Michael De Vlieger, May 27 2018 *)
  • PARI
    lista(nn) = {nb = 0; forprime(p=2, nn, m = (p % 4); if (m == 1, nb++, if (m == 3, nb--)); if (!nb, print1(p, ", ")););} \\ Michel Marcus, Oct 05 2017
    
  • Python
    from sympy import nextprime; a, p = 0, 2; R = [p]
    while p < 618637:
        p=nextprime(p); a += p%4-2
        if a == 0: R.append(p)
    print(*R, sep = ', ')  # Ya-Ping Lu, Jan 18 2025

Extensions

Corrected and extended by Enoch Haga, Feb 24 2004

A272030 Decimal expansion of C = log(2*Pi) + B_3 (where B_3 is A083343), one of Euler totient constants.

Original entry on oeis.org

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

Views

Author

Jean-François Alcover, Apr 25 2016

Keywords

Examples

			3.17045934214256636532648824888226302856125443631798948742143398...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, Section 2.7 Euler totient constants, p. 117.

Crossrefs

Programs

  • Mathematica
    digits = 98; B3 = EulerGamma - NSum[PrimeZetaP'[n], {n, 2, Infinity}, WorkingPrecision -> 2 digits, NSumTerms -> 200]; RealDigits[Log[2 Pi] + B3, 10, digits][[1]]

Formula

C = log(2*Pi) + EulerGamma - Sum_{n >= 2} P'(n), where P'(n) is the prime zeta P function derivative.

A007352 Where the prime race 3k-1 vs. 3k+1 changes leader.

Original entry on oeis.org

2, 608981813029, 608981813507, 608981813683, 608981813819, 608981814127, 608981814143, 608981818999, 608981820977, 608981826877, 608981826977, 608981827873, 608981828201, 608981836363, 608981836493, 608981836681, 608981836973, 608981836993, 608981837063
Offset: 1

Views

Author

Keywords

Comments

Terms a(2n+1) form a subsequence of A098044.

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence, although the terms are incorrect - see A185703).

Crossrefs

Extensions

Terms from a(3) onwards corrected by Max Alekseyev, Feb 10 2011

A049097 Primes p such that p+1 is squarefree.

Original entry on oeis.org

2, 5, 13, 29, 37, 41, 61, 73, 101, 109, 113, 137, 157, 173, 181, 193, 229, 257, 277, 281, 313, 317, 353, 373, 389, 397, 401, 409, 421, 433, 457, 461, 509, 541, 569, 601, 613, 617, 641, 653, 661, 673, 677, 709, 733, 757, 761, 769, 797, 821, 829, 853, 857
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that core(sigma(k)) = k + 1 where core(k) is the squarefree part of k (A007913). - Benoit Cloitre, May 01 2002
This sequence is infinite and its relative density in the sequence of primes is equal to Artin's constant (A005596): Product_{p prime} (1-1/(p*(p-1))) = 0.373955... (Mirsky, 1949). - Amiram Eldar, Dec 29 2020

Examples

			29 is included since 29 + 1 = 30 = 2*3*5 is squarefree.
17 is not here because 18 is divisible by a square, 9.
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(900) | IsSquarefree(p+1) ]; // Vincenzo Librandi, Dec 25 2010
    
  • Maple
    N:= 10000; # to get all entries up to N
    A049097:= select(t -> isprime(t) and numtheory:-issqrfree(t+1), [2, seq(1+2*k,k=1..floor((N-1)/2))]); # Robert Israel, May 11 2014
  • Mathematica
    Select[Prime[Range[100]], SquareFreeQ[# + 1] &] (* Zak Seidov, Feb 08 2016 *)
  • PARI
    lista(nn) = forprime(p=1, nn, if (issquarefree(p+1), print1(p, ", "))); \\ Michel Marcus, Jan 08 2015

Formula

A160696(a(n)) = 1. - Reinhard Zumkeller, May 24 2009
a(n) = A077067(n)-1. - Zak Seidov, Mar 19 2016

A065414 Decimal expansion of rank 2 Artin constant Product_{p prime} (1-1/(p^3-p^2)).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 15 2001

Keywords

Examples

			0.697501358496365903284670350820922924...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 2.4, p. 105.

Crossrefs

Programs

  • Mathematica
    digits = 99; m0 = 1000; dm = 100; Clear[s]; r[n_] := RootSum[-1 - #^2 + #^3 &, #^n&] - 1; s[m_] := s[m] = NSum[-r[n] PrimeZetaP[n]/n, {n, 3, m}, NSumTerms -> m0, WorkingPrecision -> 300] // Exp; s[m0]; s[m = m0 + dm]; While[RealDigits[s[m], 10, digits][[1]] != RealDigits[s[m - dm], 10, digits][[1]], Print[m]; m = m + dm]; RealDigits[s[m], 10, digits][[1]] (* Jean-François Alcover, Apr 14 2016 *)
  • PARI
    prodeulerrat(1-1/(p^3-p^2)) \\ Amiram Eldar, Mar 12 2021

A090866 Primes p == 1 (mod 4) such that (p-1)/4 is prime.

Original entry on oeis.org

13, 29, 53, 149, 173, 269, 293, 317, 389, 509, 557, 653, 773, 797, 1109, 1229, 1493, 1637, 1733, 1949, 1997, 2309, 2477, 2693, 2837, 2909, 2957, 3413, 3533, 3677, 3989, 4133, 4157, 4253, 4349, 4373, 4493, 4517, 5189, 5309, 5693, 5717, 5813, 6173, 6197
Offset: 1

Views

Author

Benoit Cloitre, Feb 12 2004

Keywords

Comments

Same as Chebyshev's subsequence of the primes with primitive root 2, because Chebyshev showed that 2 is a primitive root of all primes p = 4*q+1 with q prime. If the sequence is infinite, then Artin's conjecture ("every nonsquare positive integer n is a primitive root of infinitely many primes q") is true for n = 2. - Jonathan Sondow, Feb 04 2013

References

  • Albert H. Beiler: Recreations in the theory of numbers. New York: Dover, (2nd ed.) 1966, p. 102, nr. 5.
  • P. L. Chebyshev, Theory of congruences. Elements of number theory, Chelsea, 1972, p. 306.

Crossrefs

Programs

  • Magma
    f:=[n: n in [1..2000] | IsPrime(n) and IsPrime(4*n+1)]; [4*f[n] + 1: n in [1..50]]; // G. C. Greubel, Feb 08 2019
    
  • Mathematica
    Select[Prime[Range[1000]], Mod[#, 4]==1 && PrimeQ[(#-1)/4] &] (* G. C. Greubel, Feb 08 2019 *)
  • PARI
    isok(p) = isprime(p) && !frac(q=(p-1)/4) && isprime(q); \\ Michel Marcus, Feb 09 2019

Formula

a(n) = 4*A023212(n) + 1.

A003147 Primes p with a Fibonacci primitive root g, i.e., such that g^2 = g + 1 (mod p).

Original entry on oeis.org

5, 11, 19, 31, 41, 59, 61, 71, 79, 109, 131, 149, 179, 191, 239, 241, 251, 269, 271, 311, 359, 379, 389, 409, 419, 431, 439, 449, 479, 491, 499, 569, 571, 599, 601, 631, 641, 659, 701, 719, 739, 751, 821, 839, 929, 971, 1019, 1039, 1051, 1091, 1129, 1171, 1181, 1201, 1259, 1301
Offset: 1

Views

Author

Keywords

Comments

Primes p with a primitive root g such that g^2 = g + 1 (mod p).
Not the same as primes with a Fibonacci number as primitive root; cf. A083701. - Jonathan Sondow, Feb 17 2013
For all except the initial term 5, these are numbers such that the Pisano period equals 1 less than the Pisano number, i.e., where A001175(n) = n-1. - Matthew Goers, Sep 20 2013
As shown in the paper by Brison, these are also the primes p such that there is a Fibonacci-type sequence (mod p) that begins with (1,b) and encounters all numbers less than p in the first p-1 iterations (for some b). - T. D. Noe, Feb 26 2014
Shanks (1972) conjectured that the relative asymptotic density of this sequence in the sequence of primes is 27*c/38 = 0.2657054465..., where c is Artin's constant (A005596). The conjecture was proved on the assumption of a generalized Riemann hypothesis by Lenstra (1977) and Sander (1990). - Amiram Eldar, Jan 22 2022

Examples

			3 is a primitive root mod 5, and 3^2 = 3 + 1 mod 5, so 5 is a member. - _Jonathan Sondow_, Feb 17 2013
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A038872.
See also A106535.

Programs

  • Maple
    filter:=proc(n) local g,r;
    if not isprime(n) then return false fi;
    r:= [msolve(g^2 -g - 1, n)][1];
    numtheory:-order(rhs(op(r)),n) = n-1
    end proc:
    select(filter, [5,seq(seq(10*i+j,j=[1,9]),i=1..1000)]); # Robert Israel, May 22 2015
  • Mathematica
    okQ[p_] := AnyTrue[PrimitiveRootList[p], Mod[#^2, p] == Mod[#+1, p]&]; Select[Prime[Range[300]], okQ] (* Jean-François Alcover, Jan 04 2016 *)
  • PARI
    is(n)=if(kronecker(5,n)<1||!isprime(n), return(n==5)); my(s=sqrt(Mod(5,n))); znorder((1+s)/2)==n-1 || znorder((1-s)/2)==n-1 \\ Charles R Greathouse IV, May 22 2015

Extensions

More terms from David W. Wilson
Cross-reference from Charles R Greathouse IV, Nov 05 2009
Definition clarified by M. F. Hasler, Jun 05 2018

A003968 Möbius transform of A003959.

Original entry on oeis.org

1, 2, 3, 6, 5, 6, 7, 18, 12, 10, 11, 18, 13, 14, 15, 54, 17, 24, 19, 30, 21, 22, 23, 54, 30, 26, 48, 42, 29, 30, 31, 162, 33, 34, 35, 72, 37, 38, 39, 90, 41, 42, 43, 66, 60, 46, 47, 162, 56, 60, 51, 78, 53, 96, 55, 126, 57, 58, 59, 90, 61, 62, 84, 486, 65, 66, 67, 102, 69
Offset: 1

Views

Author

Keywords

Comments

a(n) = n for squarefree n; otherwise, a(n) > n. - Ivan Neretin, May 13 2015
Dirichlet inverse of A062953. - Werner Schulte, Oct 25 2018

Crossrefs

Programs

  • Mathematica
    Table[{pp, aa} = Transpose[FactorInteger[n]]; Times @@ (pp*(pp + 1)^(aa - 1)), {n, 70}]  (* Ivan Neretin, May 13 2015 *)
  • PARI
    a(n) = {my(f=factor(n)); for (i=1, #f~, p= f[i, 1]; f[i, 1] = p*(p+1)^(f[i,2]-1); f[i, 2] = 1); factorback(f);} \\ Michel Marcus, Feb 26 2015

Formula

Multiplicative with a(p^e) = p(p+1)^(e-1). - David W. Wilson, Sep 01 2001
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (1 + 1/(p^3 - p^2 - p)) = A104141/A005596 = 0.8128327996... . - Amiram Eldar, Oct 23 2022

Extensions

More terms from David W. Wilson, Aug 29 2001
Previous Showing 11-20 of 99 results. Next