%I #12 Nov 27 2024 18:35:16
%S 19,51,53,55,89,91,97,149,151,161,163,197,199,233,235,241,249,251,269,
%T 271,293,295,305,307,337,339,341,349,377,379,413,415,449,451,485,487,
%U 489,491,521,523,551,557,559,577,579,593,595,629,631,638,649,651,665,667
%N Squarefree numbers k whose neighbors are neither squarefree nor prime powers.
%H Michael De Vlieger, <a href="/A378179/b378179.txt">Table of n, a(n) for n = 1..10000</a>
%e Numbers k < 12 are not in the sequence since 12 is the smallest number in A126706.
%e 13 and 15 are not in the sequence since 14 is squarefree.
%e 17 is not in the sequence since 16 = 2^4.
%e a(1) = 19 since 19 is the smallest squarefree number such that 18 = 2*3^2 and 20 = 2*5^2 are not prime powers, but are divisible by a prime square.
%e a(2) = 51 since 50 = 2*5^2 and 52 = 2^2*13.
%e a(3) = 53 since 54 = 2*3^3.
%e a(4) = 55 since 56 = 7*2^3.
%e a(5) = 89 since 88 = 2^3*11 and 90 = 2*3^2*5, etc.
%t Reap[Do[If[
%t And[SquareFreeQ[n],
%t AllTrue[n + {-1, 1}, Nor[SquareFreeQ[#], PrimePowerQ[#]] &]],
%t Sow[n]], {n, 1000}] ][[-1, 1]]
%o (PARI) list(lim)=my(v=List(),l1,l2); forfactored(k=18,lim\1+1, if(!issquarefree(k) && !issquarefree(l2) && issquarefree(l1) && #k[2][,1]>1 && #l2[2][,1]>1, listput(v,l1[1])); l2=l1; l1=k); Vec(v) \\ _Charles R Greathouse IV_, Nov 27 2024
%Y Subsequence of A073247.
%Y Cf. A005117, A013929, A024619, A126706.
%K nonn,easy
%O 1,1
%A _Michael De Vlieger_, Nov 24 2024