OFFSET
1,3
COMMENTS
For n > 1: A257213(a(n)) = n. - Reinhard Zumkeller, Apr 19 2015
After the initial 1, 1, the sequence appears to alternate between runs of pronic numbers and squares with run lengths 2,2,3,3,4,4,... - Charlie Neder, Oct 04 2018
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = n^2 + floor(sqrt(n-1))*floor(sqrt(n)+1/2) - n*floor(sqrt(n-1)) - n*floor(sqrt(n)+1/2), for n>1. - Ridouane Oudra, Jun 08 2020
a(n) = n^2 - n*t + floor((t^2)/4), where t = floor(sqrt(4*n-3)) for n>1. - Ridouane Oudra, Jan 24 2023
PROG
(Haskell)
a043548 n = f 1 where
f k = if distinct $ (map (div k)) [n, n-1 .. 1] then k else f (k + 1)
distinct [_] = True; distinct (u:vs@(v:_)) = u /= v && distinct vs
-- Reinhard Zumkeller, Apr 19 2015
(PARI) a(n)={if(n==1, 1, my(t=sqrtint(4*n-3)); n^2 - n*t + t^2\4)} \\ Andrew Howroyd, Feb 04 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved