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 A379248 #43 May 25 2025 13:20:52 %S A379248 1,2,4,6,8,10,12,9,3,18,15,25,5,50,16,14,20,22,24,26,28,30,27,21,36, %T A379248 32,34,40,38,44,42,45,33,54,39,63,48,46,52,56,49,7,98,35,75,55,100,58, %U A379248 60,62,64,66,68,70,72,51,81,57,90,69,99,78,76,74,80,82,84,86,88,92,94,96,104,102,108,87,117,93,126,111,135,114,112,106,116,110,121,11,242 %N A379248 a(1) = 1, a(2) = 2, for a(n) > 2, a(n) is the smallest unused positive number that shares a factor with a(n-1) while no exponent of each distinct prime factor of a(n) is the same as the exponent of the same prime factor of a(n-1). %C A379248 For the terms studied the primes appear as terms in their natural order, and when a prime p appears as a term, the preceding term is always p^2 and the following term is always 2*p^2; it is likely this is true for all primes. A similar pattern is seen in the EKG sequence A064413 except that there a prime is always preceded by 2*p and followed by 3*p. %C A379248 Unlike the EKG sequence a prime can appear as a factor of a preceding term long before it appears as a term by itself - see A379291 for the indices where each prime first appears as a factor of a(n). %C A379248 The indices where the primes appear show an interesting pattern of runs of consecutive primes that are separated by only 6 terms, with longer, sometimes much longer, gaps in between - see A379290 and A379296. These primes appear in regions where the terms overall show a strong oscillating pattern of jumping between terms containing a prime p and p^2 as a factor. The primes being oscillated between increase until a new prime q appears in a term q^2 which leads to the next term being q. The occurrence of a new prime q can start a run of consecutive primes appearing before these oscillations subside and the terms slowly grow again until the next oscillation. See the attached graphs which show the burst/oscillating behavior, with the primes appearing in these regions, followed by terms with a slow, more linear, growth. %C A379248 In the first 500000 terms there are only six fixed points - see A379292. However, as the regions of oscillating terms crosses the a(n) = n line it is likely more exist for larger values of n. %C A379248 The sequence is conjectured to be a permutation of the positive integers. See A379293 for the index where n first appears. %H A379248 Scott R. Shannon, <a href="/A379248/b379248.txt">Table of n, a(n) for n = 1..20000</a> %H A379248 Michael De Vlieger, <a href="/A379248/a379248_3.png">Log log scatterplot of a(n)</a>, n = 1..65536. %H A379248 Michael De Vlieger, <a href="/A379248/a379248_4.png">Log log scatterplot of a(n)</a>, n = 1..16384, showing primes in red, proper prime powers in gold, squarefree composites in green, and numbers neither prime powers nor squarefree numbers in both blue and purple, where purple represents powerful numbers that are not prime powers. %H A379248 Michael De Vlieger, <a href="/A379248/a379248_5.png">Plot p^m | a(n) at (x, y) = (n, pi(p))</a>, n = 1..2048, 4X vertical exaggeration, with a color function showing m = 1 in black, m = 2 in red, m = 3 in orange, ..., m = 11 in magenta. %H A379248 Scott R. Shannon, <a href="/A379248/a379248_2.png">Image of the first 500000 terms</a>. The green line is a(n) = n. %H A379248 Scott R. Shannon, <a href="/A379248/a379248_1.png">Colored image of the first 10000 terms</a>. The terms with one, two, three,... as their maximum prime factorization exponent are colored red, orange, yellow,... . The green line is a(n) = n. %e A379248 a(3) = 4 as 4 is unused and shares a factor with a(2) = 2, while 4 = 2^2 which has 2 as the exponent of the prime 2, while a(2) = 2^1 which has exponent 1. As these are different 4 is acceptable. %e A379248 a(5) = 8 as 8 is unused and shares a factor with a(4) = 6, while 8 = 2^3 which has 3 as the exponent of the prime 2, while a(4) = 2^1*3^1 which has exponent 1. As these are different 8 is acceptable. Note that although 3 shares a factor with 6, 3 = 3^1 which has the same exponent 1 on the prime 3 as 6 = 2^1*3^1, so 3 cannot be chosen. This is the first term to differ from A064413. %t A379248 nn = 120; c[_] := False; %t A379248 f[x_] := f[x] = FactorInteger[x]; j = 2; u = 3; %t A379248 {1, 2}~Join~Reap[Do[ %t A379248 k = u; While[Or[c[k], CoprimeQ[j, k], AnyTrue[f[k], MemberQ[f[j], #] &]], k++]; %t A379248 Set[{j, c[k]}, {k, True}]; Sow[k]; %t A379248 If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* _Michael De Vlieger_, Dec 21 2024 *) %o A379248 (Python) %o A379248 from sympy import factorint %o A379248 from itertools import islice %o A379248 from collections import Counter %o A379248 fcache = dict() %o A379248 def myfactors(n): %o A379248 global fcache %o A379248 if n in fcache: return fcache[n] %o A379248 ans = Counter({p:e for p, e in factorint(n).items()}) %o A379248 fcache[n] = ans %o A379248 return ans %o A379248 def agen(): # generator of terms %o A379248 yield 1 %o A379248 an, a, m = 2, {1, 2}, 3 %o A379248 while True: %o A379248 yield an %o A379248 k, fan = m-1, myfactors(an) %o A379248 sfan = set(fan) %o A379248 while True: %o A379248 k += 1 %o A379248 if k in a: continue %o A379248 fk = myfactors(k) %o A379248 sfk = set(fk) %o A379248 if sfk & sfan and all(fk[p]!=fan[p] for p in sfan): %o A379248 an = k %o A379248 break %o A379248 a.add(an) %o A379248 print(list(islice(agen(), 89))) # _Michael S. Branicky_, Jan 05 2025 %Y A379248 Cf. A124010, A027746, A051903, A064413, A348086, A375564, A375563, A373546, A373545. %Y A379248 Cf. A379290 (index where prime n appears as a term), A379296 (differences between indices where prime terms appear), A379291 (index where prime n first appears as a factor of a(n)), A379293 (index where n appears as a term), A379292 (fixed points), A379294 (record high values), A379295 (indices of record high values). %K A379248 nonn,look %O A379248 1,2 %A A379248 _Scott R. Shannon_, Dec 18 2024