cp's OEIS Frontend

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.

A359243 a(1) = 1, a(2) = 2; let j = a(n-1); for n > 2, if j is prime then a(n) = least novel k such that phi(k)/k < phi(j)/j, else a(n) = least novel k such that phi(k)/k > phi(j)/j, where phi(x) = A000010(x).

This page as a plain text file.
%I A359243 #14 Mar 16 2023 02:37:43
%S A359243 1,2,6,3,4,5,8,7,9,11,10,13,12,14,15,17,16,19,18,20,21,23,22,25,29,24,
%T A359243 26,27,31,28,32,33,35,37,30,34,38,39,41,36,40,43,42,44,45,47,46,49,53,
%U A359243 48,50,51,55,59,52,57,61,54,56,58,62,63,65,67,60,64,69,71
%N A359243 a(1) = 1, a(2) = 2; let j = a(n-1); for n > 2, if j is prime then a(n) = least novel k such that phi(k)/k < phi(j)/j, else a(n) = least novel k such that phi(k)/k > phi(j)/j, where phi(x) = A000010(x).
%C A359243 Permutation of natural numbers.
%C A359243 Once we have a(n) = prime(m), we require a(n+1) = u, the smallest missing number. Thereafter, we find the smallest k new to the sequence such that phi(k)/k > phi(j)/j, where j = a(n-1) until we reach another prime. Primes appear in order, since phi(p)/p = (p-1)/p.
%C A359243 Sequence can be interpreted as an irregular triangle where row 0 = {1} and row m > 1 begins with prime(m). In such a triangle, we observe prime(m) > min(row m) for m > 5, yet we can find prime(m) either less than or exceeding max(row m) for 2^20 terms of this sequence, or m = 1..82032.
%C A359243 Since phi(k)/k ascribes to squarefree kernel K = rad(k) = A007947(k) and K < mK where mK is nonsquarefree yet rad(m) | K, squarefree k appear before mK. For example, a(3) = 6 and a(13) = 12; a(11) = 10 and a(20) = 20, etc.
%C A359243 Odd prime numbers tend to appear early, even numbers tend to appear late.
%H A359243 Michael De Vlieger, <a href="/A359243/b359243.txt">Table of n, a(n) for n = 1..16384</a>
%H A359243 Michael De Vlieger, <a href="/A359243/a359243.png">Scatterplot of a(n) - n</a>, n = 1..300, showing primes in red, odd nonprime in blue, even composites in gold, and primorials in magenta.
%H A359243 Michael De Vlieger, <a href="/A359243/a359243_1.png">Scatterplot of a(n) - n</a>, n = 1..2^16 with color function as immediately above.
%H A359243 Michael De Vlieger, <a href="/A359243/a359243_2.png">Scatterplot of a(n) - n</a>, n = 1..300, showing primes in red, composite prime powers (in A246547) in gold, squarefree composites (in A120944) in green, numbers neither squarefree nor prime power (in A126706) in small blue, products of composite prime powers (in A286708) in large blue, and primorials in magenta.
%H A359243 Michael De Vlieger, <a href="/A359243/a359243_3.png">Scatterplot of a(n) - n</a>, n = 1..2^16 with color function as immediately above.
%H A359243 Michael De Vlieger, <a href="/A359243/a359243_4.png">Scatterplot of phi(a(n))</a> for n = 1..2^12 with color function as immediately above. This plot relates to that of A307540.
%e A359243 Let f(x) = phi(x)/x.
%e A359243 a(3) = 6 since 2 is prime and f(k) >= f(2) = 1/2 for k in {3, 4, 5}.
%e A359243 a(4) = 3 since f(3) < f(6) = 1/3.
%e A359243 a(5) = 4 since 3 is prime and f(4) < f(3) = 2/3.
%e A359243 a(6) = 5 since f(5) > f(4) = 1/2.
%e A359243 a(7) = 8 since 5 is prime and f(7) >= f(5) = 4/5 but f(8) = 1/2 < 4/5, etc.
%e A359243 Sequence written as an irregular triangle where row 0 = {1} and row m starts with prime(m):
%e A359243    1;
%e A359243    2,  6;
%e A359243    3,  4;
%e A359243    5,  8;
%e A359243    7,  9;
%e A359243   11, 10;
%e A359243   13, 12, 14, 15;
%e A359243   17, 16;
%e A359243   19, 18, 20, 21;
%e A359243   23, 22, 25;
%e A359243   29, 24, 26, 27;
%e A359243   31, 28, 32, 33, 35; ...
%t A359243 nn = 120; c[_] = False; f[n_] := EulerPhi[n]/n; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; j = a[2]; m = f[j]; u = 3; Do[k = u; If[PrimeQ[j], While[Nand[! c[k], f[k] < m], k++], While[Nand[! c[k], f[k] > m], k++]]; Set[{a[n], c[k], j, m}, {k, True, k, f[k]}]; If[k == u, While[c[u], u++]], {n, 3, nn}]; Array[a, nn]
%Y A359243 Cf. A000010, A000040, A002110, A007947, A307540.
%K A359243 nonn
%O A359243 1,2
%A A359243 _Michael De Vlieger_, Jan 16 2023