A049204 Duplicate of A045924.
1, 2, 3, 4, 10, 70, 72, 182, 440, 1053, 6458, 6461, 6471, 40087, 40089, 251737
Offset: 1
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.
a004648 n = a004648_list !! (n-1) a004648_list = zipWith mod a000040_list [1..] -- Reinhard Zumkeller, Jul 30 2012
[(NthPrime(n) mod n): n in [1..100]]; // Vincenzo Librandi, Apr 06 2011
A004648 := proc(n) modp(ithprime(n),n) ; end proc: # R. J. Mathar, Dec 02 2014
Table[Mod[Prime[n], n], {n, 100}] (* Zak Seidov, Apr 25 2005 *)
for(n=1,100,print1(prime(n)%n,","))
from sympy import prime; print([prime(i) % i for i in range(1, 101)]) # Jwalin Bhatt, Jul 29 2025
def A004648(n): return (nth_prime(n)%n) [A004648(n) for n in range(1,101)] # G. C. Greubel, Apr 20 2023
6 is in the sequence because the 6th prime, 13, is congruent to 1 (mod 6).
import Data.List (elemIndices) a023143 n = a023143_list !! (n-1) a023143_list = 1 : map (+ 1) (elemIndices 1 a004648_list) -- Reinhard Zumkeller, Jul 30 2012, Jun 08 2011
[n: n in [1..10000] | IsIntegral((NthPrime(n)-1)/n)]; // Marius A. Burtea, Dec 30 2018
Do[ If[ IntegerQ[ (Prime[ n ] - 1) / n ], Print[ n ] ], {n, 1, 10^8} ]
n=0; print1(1); forprime(p=2,1e9, if(p%n++==1, print1(", "n))) \\ Charles R Greathouse IV, Apr 28 2015
def A023143(end): primes=[2,3] a023143_list=[1] num=3 while len(primes)<=end: num+=1 prime=False length=len(primes) for y in range(0,length): if num % primes[y]!=0: prime=True else: prime=False break if (prime): primes.append(num) for x in range(2, len(primes)): if (primes[x-1]%(x))==1: a023143_list.append(x) return a023143_list # Conner L. Delahanty, Apr 19 2014
from sympy import primerange def A023143(end): return [n+1 for n, p in enumerate(primerange(2, end)) if (p-1) % (n-1) == 0] # David Radcliffe, Jun 27 2016
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 2, Print[n]], {n, 1, 10^9}]
for(i=1,10^9,if(Mod(prime(i),i)==-2,print1(i,",")));
13 is the 6th prime and 13 == 1 mod 6.
f[p_,n_]:=Mod[p,n]==0; lst={};Do[p=Prime[n];If[f[p-1,n],AppendTo[lst,p]],{n,10!}];lst (* Vladimir Joseph Stephan Orlovsky, Dec 08 2009 *)
lista(nn) = forprime(p=1, nn, if (Mod(p, primepi(p)) == 1, print1(p, ", "))); \\ Michel Marcus, Jan 08 2015; Aug 06 2019
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 3, Print[n]], {n, 1, 10^9}] Join[{1,2},Select[Range[5 10^6],Mod[Prime[#],#]==#-3&]] (* Harvey P. Dale, Mar 29 2023 *)
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 9, Print[n]], {n, 1, 10^9}]
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 4, Print[n]], {n, 1, 10^9}]
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 5, Print[n]], {n, 1, 10^9}]
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[ Mod[p = NextPrim[p], n] == n - 6, Print[n]], {n, 1, 10^9}]
Comments