OFFSET
2,5
LINKS
Simon Strandgaard, Plot of 10000 terms with primes highlighted
FORMULA
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