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 21-30 of 57 results. Next

A116659 Numbers k such that prime(k) == 14 (mod k).

Original entry on oeis.org

1, 3, 9, 23, 81, 85, 87, 16057, 4124457, 27067011, 27067127, 1208198605, 1208198851
Offset: 1

Views

Author

Zak Seidov, Feb 21 2006

Keywords

Comments

Starting with a(4), positions of 14 in A004648. - Robert G. Wilson v, Feb 22 2006, corrected by Eric M. Schmidt, Feb 05 2013

Crossrefs

Cf. A004648; A023143 - A023152, A116657, A116677, A116658, A116659: prime(n) == m (mod n), m=1..14.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == 14, Print[n]], {n, 10^9}] (* Robert G. Wilson v *)
  • Sage
    def A116659(max) :
        terms = []
        p = 2
        for n in range(1, max+1) :
            if (p - 14) % n == 0 : terms.append(n)
            p = next_prime(p)
        return terms
    # Eric M. Schmidt, Feb 05 2013

Extensions

a(9)-a(13) from Robert G. Wilson v, Feb 22 2006
First three terms inserted by Eric M. Schmidt, Feb 05 2013

A072630 Values of n where A072629 switches from 01010.. into 0000.. or back.

Original entry on oeis.org

1, 7, 19, 53, 147, 403, 1095, 2979, 8103, 22025, 59873, 162753, 442413, 1202603, 3269017, 8886109, 24154951, 65659969, 178482299, 485165195, 1318815733, 3584912845, 9744803445, 26489122129, 72004899337, 195729609427
Offset: 1

Views

Author

Labos Elemer, Jun 28 2002

Keywords

Crossrefs

Programs

  • Mathematica
    m[x_] := Mod[x*Floor[Log[x]//N],2]; Do[s=m[n]+m[n+1]; s1=m[n+1]+m[n+2]; If[ !Equal[s1,s],Print[n]],{n,1,1000000}]

Formula

See program below.
a(n) = A000149(n) or A000149(n)-1 whichever is odd. [From Max Alekseyev, Feb 06 2010]

Extensions

More terms from Max Alekseyev, Feb 06 2010

A065863 Remainder when n-th prime is divided by the number of nonprimes not exceeding n.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 3, 3, 5, 1, 2, 6, 3, 2, 3, 9, 6, 1, 11, 8, 9, 13, 14, 1, 16, 13, 12, 14, 13, 7, 5, 5, 1, 5, 1, 7, 7, 5, 5, 11, 7, 17, 13, 11, 7, 19, 25, 23, 19, 17, 17, 19, 23, 23, 23, 23, 19, 25, 23, 25, 29, 37, 35, 31, 29, 43, 43, 47, 43, 47, 47, 3, 2, 1, 53, 53, 55, 2, 3, 6, 1, 11, 6
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			For n=25, prime(25)=97, n - pi(n) = 25 - 9 = 16, a(25)=1 because 97 = 6*16 + 1.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[Prime[n],n-PrimePi[n]],{n,90}] (* Harvey P. Dale, Aug 04 2015 *)
  • PARI
    a(n) = { prime(n)%(n - primepi(n)) } \\ Harry J. Smith, Nov 02 2009

Formula

a(n) = prime(n) mod (n - pi(n)) = A000040(n) mod A062298(n).

A072631 Floor( n*log(n) ) mod n.

Original entry on oeis.org

0, 1, 0, 1, 3, 4, 6, 0, 1, 3, 4, 5, 7, 8, 10, 12, 14, 16, 17, 19, 0, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 24, 25, 27, 29, 30, 32, 34, 36, 38, 39, 41, 43, 45, 47, 49, 51, 53, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29
Offset: 1

Views

Author

Labos Elemer, Jun 28 2002

Keywords

Comments

Compare with A004648 because prime(n) ~ n * log(n).

Crossrefs

Programs

A073325 a(n) = least k > 0 such that prime(k) == n (mod k).

Original entry on oeis.org

1, 2, 3, 4, 75, 9, 79, 18, 17, 10, 19, 20, 91, 22, 23, 41, 83, 24, 16049, 43, 2711, 94, 25, 26, 95, 198, 449, 452, 99, 50, 451, 48, 453, 1072, 447, 54, 16043, 55, 2719, 56, 459, 57, 101, 472, 100371, 62, 105, 102, 103, 104, 467, 110, 107, 65, 109, 63, 115, 118, 117
Offset: 1

Views

Author

Labos Elemer, Jul 30 2002

Keywords

Comments

First appearance of n-1 in A004648. Are all positive integers present in A004648 and hence in this sequence? - Zak Seidov, Sep 02 2012

Examples

			a(4) = 75 as prime(75) = 379 == 4 (mod 75).
a(44) = 100371 since prime(100371) = 1304867 == 44 (mod 100371) and prime(k) <> 44 (mod k) for k < 100371.
		

Crossrefs

Programs

  • Mathematica
    nn = 60; f[x_] := Mod[Prime[x], x]; t = Table[0, {nn}]; k = 0; While[Times @@ t == 0, k++; n = f[k]; If[n <= nn && t[[n]] == 0, t[[n]] = k]]; Join[{1}, t]
    lk[n_]:=Module[{k=1},While[Mod[Prime[k],k]!=n,k++];k]; Array[lk,60,0] (* Harvey P. Dale, Nov 29 2013 *)
  • PARI
    stop=110000; for(n=0,59,k=1; while(k
    				
  • Python
    from sympy import prime, nextprime
    def A073325(n):
        p, m = prime(n), n
        while p%m != n-1:
            p = nextprime(p)
            m += 1
        return m # Chai Wah Wu, Mar 18 2023

Formula

a(n) = Min{x; Mod[A000040(x), x]=n} = Min{x; A004648[x]=n}.

Extensions

Definition revised by N. J. A. Sloane, Aug 12 2009
A216162 merged into this sequence by T. D. Noe, Sep 07 2012

A125718 a(1)=1. a(n) = the smallest positive integer not occurring earlier in the sequence such that the n-th prime is congruent to a(n) (mod n).

Original entry on oeis.org

1, 3, 2, 7, 6, 13, 10, 11, 5, 9, 20, 25, 15, 29, 17, 21, 8, 43, 48, 31, 52, 35, 14, 41, 22, 23, 49, 51, 80, 53, 34, 67, 38, 37, 44, 79, 46, 87, 50, 93, 56, 55, 19, 61, 62, 107, 70, 127, 129, 179, 131, 83, 82, 89, 92, 39, 98, 97, 100, 101, 161, 45, 118, 119, 183, 185, 63, 65
Offset: 1

Views

Author

Leroy Quet, Feb 01 2007

Keywords

Comments

This sequence seems likely to be a permutation of the positive integers. It will be if every positive number appears in A004648 (cf. A127149, A127150).
If this is a permutation of the positive integers, then A249678 is the inverse permutation. - M. F. Hasler, Nov 03 2014

Crossrefs

Cf. A004648.

Programs

  • Mathematica
    f[l_List] := Block[{n = Length[l] + 1, k = Mod[Prime[n], n, 1]},While[MemberQ[l, k], k += n];Append[l, k]];Nest[f, {1}, 70] (* Ray Chandler, Feb 04 2007 *)
  • PARI
    {Quet_p3(n)= /* Permutation sequence a'la Leroy Quet, A125718 */local(x=[1],k=0,w=1); for(i=2,n,if((k=prime(i)%i)==0,k=i);while(bittest(w,k-1)>0,k+=i);x=concat(x,k);w+=2^(k-1));return(x)}
    
  • PARI
    A125718(n,show=0,u=1)={for(n=1,n,p=prime(n)%n;while(bittest(u,p),p+=n);u+=1<M. F. Hasler, Nov 03 2014

Extensions

Extended by Ray Chandler, Feb 04 2007

A127064 a(0)=1. a(n) = a(prime(n)(mod n)) + 1, where prime(n) is the n-th prime.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Mar 21 2007

Keywords

Examples

			The 7th prime, 17, is congruent to 3 (mod 7). So a(7) = a(3) + 1 = 4 + 1 = 5.
		

Crossrefs

Programs

  • Maple
    a[0]:=1: for n from 1 to 125 do a[n]:=1+a[ithprime(n) mod n] od: seq(a[n],n=0..125); # Emeric Deutsch, Mar 25 2007
  • Mathematica
    f[l_List] := Block[{n = Length[l]},Append[l, l[[Mod[Prime[n], n] + 1]] + 1]];Nest[f, {1}, 105] (* Ray Chandler, Mar 25 2007 *)
  • PARI
    a(n)={k=1;if(n>0,k=a(prime(n)%n)+1);k;} \\ Jinyuan Wang, Feb 01 2019

Extensions

Extended by Ray Chandler and Emeric Deutsch, Mar 25 2007

A004650 a(n) = prime(n) mod (n+1).

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 1, 1, 3, 7, 7, 11, 13, 13, 15, 2, 5, 4, 7, 8, 7, 10, 11, 14, 19, 20, 19, 20, 19, 20, 31, 32, 1, 34, 5, 3, 5, 7, 7, 9, 11, 9, 15, 13, 13, 11, 19, 27, 27, 25, 25, 27, 25, 31, 33, 35, 37, 35, 37, 37, 35, 41, 51, 51, 49, 49, 59, 61, 67, 65, 65, 67
Offset: 1

Views

Author

N. J. A. Sloane, Daniel Wild (wild(AT)edumath.u-strasbg.fr)

Keywords

Crossrefs

Programs

A065859 Remainder when the n-th prime is divided by the n-th composite number.

Original entry on oeis.org

2, 3, 5, 7, 1, 1, 3, 4, 7, 11, 11, 16, 19, 19, 22, 1, 5, 5, 7, 7, 7, 11, 13, 17, 21, 23, 23, 23, 21, 23, 35, 35, 39, 39, 47, 47, 49, 53, 55, 2, 5, 1, 5, 4, 5, 4, 13, 19, 20, 19, 17, 17, 16, 23, 26, 29, 29, 28, 31, 29, 28, 35, 46, 47, 43, 44, 55, 58, 65, 64, 65, 65, 70, 73, 73, 71
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			n=100, p(100)=541, c(100)=133, a(100)=9 because 541 = 4*133 + 9.
		

Crossrefs

Programs

  • Mathematica
    a[n]=Mod[p(n), c(n)]=Mod[A000040(n), A002808(n)]
    With[{nn=80},Module[{prs=Prime[Range[nn]],comps},comps=Take[Complement[ Range[2,Prime[nn]+1],prs],Length[prs]];Mod[#[[1]],#[[2]]]&/@ Thread[ {prs,comps}]]] (* Harvey P. Dale, Apr 18 2012 *)
  • PARI
    Composite(n) = { local(k); k=n + primepi(n) + 1; while (k != n + primepi(k) + 1, k = n + primepi(k) + 1); return(k) } { for (n = 1, 1000, a=prime(n)%Composite(n); write("b065859.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 01 2009

A072629 Parity of n*floor(log n).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Labos Elemer, Jun 28 2002

Keywords

Comments

a(n)=1 for n: 3, 5, 7, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 149, 151, .... - Robert G. Wilson v, Feb 01 2015

Examples

			Parity either alternates or it is steadily 0. Intervals of such kind also change and return: 01010...0000....0101.., etc.
		

Crossrefs

Programs

Formula

a(n) = n*floor(log(n)) mod 2.
Previous Showing 21-30 of 57 results. Next