The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A306284 a(n) is the smallest positive integer x such that x > y >= 0 and n divides x^2 - y^2. 1
 1, 2, 2, 2, 3, 4, 4, 3, 3, 6, 6, 4, 7, 8, 4, 4, 9, 6, 10, 6, 5, 12, 12, 5, 5, 14, 6, 8, 15, 8, 16, 6, 7, 18, 6, 6, 19, 20, 8, 7, 21, 10, 22, 12, 7, 24, 24, 7, 7, 10, 10, 14, 27, 12, 8, 9, 11, 30, 30, 8, 31, 32, 8, 8, 9, 14, 34, 18, 13, 12, 36, 9, 37, 38, 10, 20, 9, 16, 40, 9, 9, 42, 42, 10, 11, 44, 16 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Different from A306271: here x^2 mod n is not necessarily a square. For most n, a(n) != A306271(n). It seems that n divides a(n)^2 if and only if n divides A306271(n)^2. a(n) >= sqrt(n) with equality if and only if n is a square. - Robert Israel, Feb 05 2019 LINKS Robert Israel, Table of n, a(n) for n = 1..10000 FORMULA a(n^2) = n. a(p) = (p + 1)/2 for primes p > 2. For odd primes p and q, a(p*q) = (p+q)/2. - Robert Israel, Feb 08 2019 EXAMPLE a(10) = 6 because 10 divides 6^2 - 4^2 = 10, and 6 is the smallest possible value for x such that x > y >= 0 and that 10 divides x^2 - y^2. a(87) = 16 because 87 divides 16^2 - 13^2 = 87, and 16 is the smallest possible value for x such that x > y >= 0 and that 87 divides x^2 - y^2. MAPLE f:= proc(n) local S, x, t; S:= {0}: for x from 1 do   t:= x^2 mod n;   if member(t, S) then return x     else S:= S union {t}   fi od end proc: map(f, [\$1..100]); # Robert Israel, Feb 05 2019 PROG (PARI) a(n) = for(x=1, n, for(y=0, x-1, if((x^2-y^2)%n==0, return(x)))) CROSSREFS Cf. A048152, A306271. Sequence in context: A085313 A065458 A144000 * A318816 A085202 A096009 Adjacent sequences:  A306281 A306282 A306283 * A306285 A306286 A306287 KEYWORD nonn,look AUTHOR Jianing Song, Feb 03 2019 STATUS approved

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

Last modified May 28 04:00 EDT 2020. Contains 334671 sequences. (Running on oeis4.)