The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A123123 Numbers m such that m mod k = 2 for only one integer k in 2..m. 0
5, 6, 7, 9, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265, 271, 273, 279 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
From 7 on, sequence gives primes + two. This can be easily seen since the definition is equivalent to the following: "Numbers m such that there's only one k, 2 <= k <= m-2, that divides m-2." So k|(m-2) and values of k: m and m-1 are not considered since they don't divide m-2. But this 2nd statement is also the same as saying that m-2 is a prime number and so m = prime + 2.
Essentially the same as A048974. - R. J. Mathar, Jun 18 2008
LINKS
FORMULA
a(n) = prime(n) + 2 = A000040(n) + 2 for n >= 3 (prime(3) = 5 > 4).
MATHEMATICA
Join[{5, 6}, Prime[Range[3, 60]]+2] (* Harvey P. Dale, Sep 05 2017 *)
PROG
(PARI) for(n=1, 500, if(sum(k=2, n, if(n%k==2, 1, 0))==1, print1(n, ", ")))
(Python)
from sympy import prime
a = lambda n : 5 if n==1 else (6 if n==2 else prime(n)+2)
# Christoph B. Kassir, Apr 14 2022
CROSSREFS
Sequence in context: A279001 A080708 A047576 * A308892 A092858 A138966
KEYWORD
nonn
AUTHOR
Jared B. Ricks (jaredricks(AT)yahoo.com), Sep 24 2006
EXTENSIONS
Edited by Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 24 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 12 02:30 EDT 2024. Contains 373321 sequences. (Running on oeis4.)