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 A371473 #31 Apr 20 2024 10:14:27 %S A371473 1,3,6,10,15,21,28,14,23,33,44,22,35,49,7,23,40,10,29,49,7,29,52,26, %T A371473 51,77,104,26,55,85,116,58,91,125,5,41,78,116,58,98,14,56,14,58,103, %U A371473 149,196,14,63,21,72,6,59,113,168,42,99,33,92,46 %N A371473 a(1) = 1; for n>1, if a(n-1) is squarefree, a(n) = a(n-1) + n, otherwise a(n) = squarefree kernel of a(n-1). %C A371473 Inspired by Recaman's sequence A005132. %C A371473 Some nonsquarefree numbers will not appear in this sequence. However, I conjecture that all squarefree numbers will appear. First occurrence of 2 is at a(766) = 2. %H A371473 Joseph C. Y. Wong, <a href="/A371473/b371473.txt">Table of n, a(n) for n = 1..10000</a> %e A371473 a(1) = 1 is squarefree, so a(2) = a(1) + 2 = 3. %e A371473 a(7) = 28 = 2*2*7 is not squarefree, so a(8) = 2*7 = 14. %t A371473 rad[n_]:=Product[Part[First/@FactorInteger[n],i],{i,Length[FactorInteger[n]]}]; a[1]=1; a[n_]:=If[SquareFreeQ[a[n-1]],a[n-1]+n,rad[a[n-1]]]; Array[a,60] (* _Stefano Spezia_, Mar 26 2024 *) %o A371473 (Python) %o A371473 from numpy import prod %o A371473 def primefact(a): %o A371473 factors = [] %o A371473 d = 2 %o A371473 while a > 1: %o A371473 while a % d == 0: %o A371473 factors.append(d) %o A371473 a /= d %o A371473 d = d + 1 %o A371473 return factors %o A371473 def squarefree(a): %o A371473 return sorted(list(set(primefact(a)))) == sorted(primefact(a)) %o A371473 sequence = [1] %o A371473 a = 1 %o A371473 for n in range(1, 1001): %o A371473 if not squarefree(a): %o A371473 a = prod(list(set(primefact(a)))) %o A371473 else: %o A371473 a += n+1 %o A371473 sequence.append(a) %o A371473 print(sequence) %o A371473 (PARI) lista(nn) = my(v = vector(nn)); v[1] = 1; for (n=2, nn, if (issquarefree(v[n-1]), v[n] = v[n-1]+n, v[n] = factorback(factor(v[n-1])[,1]));); v; \\ _Michel Marcus_, Mar 26 2024 %Y A371473 Cf. A005132, A005117, A007947. %K A371473 nonn %O A371473 1,2 %A A371473 _Joseph C. Y. Wong_, Mar 24 2024