If you know math, you immediately recognize that a smallest degree polynomial that has values 0,1,4,9,16,25,35 at 0,1,2,3,4,5,6 respectively is f(x) = xx - x(x-1)(x-2)(x-3)(x-4)(x-5)/720
So you know that f(n)=n(n+1)(2*n+1)/6 won't work and ChatGPT is bullshiting you.
https://news.ycombinator.com/item?id=34473783
If you know math, you immediately recognize that a smallest degree polynomial that has values 0,1,4,9,16,25,35 at 0,1,2,3,4,5,6 respectively is f(x) = xx - x(x-1)(x-2)(x-3)(x-4)(x-5)/720
So you know that f(n)=n(n+1)(2*n+1)/6 won't work and ChatGPT is bullshiting you.