This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A075052 #17 Aug 09 2024 10:07:20 %S A075052 1,3,4,1,7,9,2,9,13,15,17,19,21,4,19,25,27,20,9,31,33,35,19,18,39,41, %T A075052 43,28,17,47,49,51,53,55,57,59,61,39,24,65,67,69,71,35,38,75,77,79,81, %U A075052 47,36,85,87,89,91,81,12,95,97,99,101,103,40,65,107,109,111,113,115,11 %N A075052 Write down squares and cubes in order, as in A002760. The sequence gives the first differences between terms. %C A075052 Ordered sequence of squares and cubes is as in A002760. %H A075052 Alois P. Heinz, <a href="/A075052/b075052.txt">Table of n, a(n) for n = 1..20000</a> %F A075052 a(n) = A002760(n+1) - A002760(n). %e A075052 First sorted squares and cubes are: 0, 1, 4, 8, 9, 16, 25, 27, 36, 49, 64, 81, 100, hence a(1) = 1 - 0 = 1, a(10) = 64 - 49 = 15, a(12) = 100 - 81 = 19. %t A075052 Module[{nn=70,sq,cb},sq=Range[0,nn]^2;cb=Select[Range[nn]^3,#<=sq[[-1]]&];Join[sq,cb]//Union//Differences] (* _Harvey P. Dale_, Jun 11 2024 *) %o A075052 (PARI) lista(nn) = {vec = vector(nn, i, i-1); pp = select(i->(issquare(i) || (ispower(i, 3))), vec); for (i=1, #pp-1, print1(pp[i+1] - pp[i], ", "););} \\ _Michel Marcus_, Oct 03 2013 %o A075052 (Python) %o A075052 from math import isqrt %o A075052 from sympy import integer_nthroot %o A075052 def A075052(n): %o A075052 def f(x): return n-1+x+integer_nthroot(x,6)[0]-(b:=integer_nthroot(x,3)[0])-(a:=isqrt(x)), a, b %o A075052 m = n-1 %o A075052 k, a, b = f(n-1) %o A075052 while m != k: %o A075052 m = k %o A075052 k, a, b = f(k) %o A075052 return min((a+1)**2,(b+1)**3)-m # _Chai Wah Wu_, Aug 09 2024 %Y A075052 Cf. A002760. %K A075052 nonn %O A075052 1,2 %A A075052 _Zak Seidov_, Oct 07 2002