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!)
A256245 a(n) is the smallest positive number m such that n+3*m is a square, or 0 if no such m exists. 0
1, 0, 2, 4, 0, 1, 3, 0, 9, 2, 0, 8, 1, 0, 7, 3, 0, 6, 2, 0, 5, 1, 0, 4, 8, 0, 3, 7, 0, 2, 6, 0, 1, 5, 0, 15, 4, 0, 14, 3, 0, 13, 2, 0, 12, 1, 0, 11, 5, 0, 10, 4, 0, 9, 3, 0, 8, 2, 0, 7, 1, 0, 6, 12, 0, 5, 11, 0, 4, 10, 0, 3, 9, 0, 2, 8, 0, 1, 7, 0, 21, 6, 0, 20, 5, 0, 19, 4, 0, 18, 3, 0, 17, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n)=0 iff n==2 mod 3 because 2 is quadratic nonresidue of 3.
EXAMPLE
1 + 3*1 = 4 = 2^2, 3 + 3*2 = 9 = 3^2, 4 + 3*4 = 16 = 4^2.
MATHEMATICA
Table[m = 1; If[Mod[n, 3] == 2, m = 0, While[! IntegerQ[Sqrt[n + 3*m]], m++]]; m, {n, 100}] (* Michael De Vlieger, Mar 20 2015 *)
PROG
(PARI) a(n)=if(n==Mod(2, 3), return(0)); m=1; while(!issquare(n+3*m), m++); m
vector(100, n, a(n)) \\ Derek Orr, Mar 22 2015
CROSSREFS
Cf. A256243.
Sequence in context: A130659 A083741 A258761 * A173004 A118343 A309148
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Mar 20 2015
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 April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)