login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A338227
a(n) = x(n) mod floor(sqrt(x(n))), where x(n) = floor((n^2)/2).
1
0, 0, 0, 0, 2, 0, 2, 4, 1, 4, 0, 3, 8, 2, 7, 0, 6, 11, 4, 10, 2, 8, 0, 6, 14, 3, 12, 0, 9, 18, 6, 15, 2, 12, 23, 8, 20, 4, 16, 0, 12, 24, 7, 20, 2, 15, 30, 10, 25, 4, 20, 35, 14, 30, 8, 24, 1, 18, 36, 11, 30, 4, 23, 42, 16, 35, 8, 28, 0, 20, 42, 12, 34, 3
OFFSET
2,5
FORMULA
a(n) = A007590(n) mod A000196(A007590(n)).
a(n) = A007590(n) mod A049472(n). - Kevin Ryde, Jan 30 2021
EXAMPLE
x( 7) = floor(( 7^2)/2) = 24, a( 7) = 24 mod floor(sqrt(24)) = 24 mod 4 = 0,
x( 8) = floor(( 8^2)/2) = 32, a( 8) = 32 mod floor(sqrt(32)) = 32 mod 5 = 2,
x( 9) = floor(( 9^2)/2) = 40, a( 9) = 40 mod floor(sqrt(40)) = 40 mod 6 = 4,
x(10) = floor((10^2)/2) = 50, a(10) = 50 mod floor(sqrt(50)) = 50 mod 7 = 1.
MATHEMATICA
x[n_] := Floor[(n^2)/2]; A338227[n_] := Mod[x[n], Floor[Sqrt[x[n]]]]; Table[A338227[n], {n, 2, 75}] (* Robert P. P. McKone, Jan 31 2021 *)
PROG
(Ruby) values = Array.new(50) do |i|
x = ((i + 2) ** 2) / 2
x % Integer.sqrt(x)
end
p values
(PARI) a(n) = my(x=n^2\2); x % sqrtint(x); \\ Michel Marcus, Jan 31 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Jan 30 2021
STATUS
approved