

A282026


a(n) = smallest m with gcd(m, 2*n+1) = 1 such that 2(n+m)+1 is composite.


4



4, 11, 2, 1, 8, 2, 1, 17, 2, 1, 2, 1, 1, 4, 2, 1, 1, 2, 1, 5, 2, 1, 2, 1, 1, 2, 1, 1, 4, 2, 1, 1, 2, 1, 4, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 8, 2, 1, 8, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 4, 2, 1, 1, 1, 1, 4, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 4, 2, 1, 1, 1, 1, 8, 2, 1, 4, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,1


COMMENTS

Starting at 2n+1, find the next odd composite number 2n+1+2m that is relatively prime to 2n+1; then a(n) = m.
Since 2n+3 is relatively prime to 2n+1, and (2n+3)^2 is composite, a(n) <= 2n^2+5n+4 (this is tight for n=0 and n=1).
From Andrey Zabolotskiy, Feb 13 2017: (Start)
Up to n = 10^7, a(n) are from the set [1, 2, 4, 5, 7, 8, 11, 13, 14, 16, 17, 19, 22]. First occurrence of 14 is a(99412), first occurrence of 22 is a(7225627). [Thanks to Altug Alkan for pointing out a(99412).]
a(n) = 1 iff n is in A153238.
(End)
From N. J. A. Sloane, Feb 13 2017: (Start)
Based on Altug Alkan's bfile, the records in this sequence are 4, 11, 17, 19, ... and occur at positions 1, 2, 8, 638, ... If the sequence is unbounded, then these two subsidiary sequences should be added to the OEIS.
Also the sequence of values taken by a(n), which as Andrey Zabolotskiy and Altug Alkan determined, includes the values 1, 2, 4, 5, 7, 8, 11, 13, 14, 16, 17, 19, 22 (and possibly others) could also be added to the OEIS (if it is new). (End)


LINKS

Altug Alkan, Table of n, a(n) for n = 0..10000


EXAMPLE

When n=1, 2n+1=3, and 5,7,9,11,13,15,17,19,21,23 are all either prime or have a common factor with 3. The next term, 25, is OK, and so a(1) = (253)/2 = 11.


MATHEMATICA

Table[m = 1; While[Nand[CoprimeQ[m, 2 n + 1], CompositeQ[2 (n + m) + 1]], m++]; m, {n, 0, 120}] (* Michael De Vlieger, Feb 18 2017 *)


PROG

(PARI) a(n) = my(k=1); while(isprime(2*n+2*k+1)  gcd(2*n+1, k) != 1, k++); k; \\ Altug Alkan, Feb 13 2017


CROSSREFS

Cf. A153238.
Sequence in context: A175668 A113249 A087171 * A066333 A230870 A115642
Adjacent sequences: A282023 A282024 A282025 * A282027 A282028 A282029


KEYWORD

nonn


AUTHOR

N. J. A. Sloane, Feb 12 2017


EXTENSIONS

Definition corrected by Altug Alkan, Feb 13 2017


STATUS

approved



