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 A305801 #32 Oct 19 2021 11:02:24 %S A305801 1,2,3,4,3,5,3,6,7,8,3,9,3,10,11,12,3,13,3,14,15,16,3,17,18,19,20,21, %T A305801 3,22,3,23,24,25,26,27,3,28,29,30,3,31,3,32,33,34,3,35,36,37,38,39,3, %U A305801 40,41,42,43,44,3,45,3,46,47,48,49,50,3,51,52,53,3,54,3,55,56,57,58,59,3,60,61,62,3,63,64,65,66,67,3,68,69,70,71,72,73,74,3,75,76,77,3,78,3,79,80 %N A305801 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = 0 if n is an odd prime, with f(n) = n for all other n. %C A305801 The original name was: "Filter sequence for a(odd prime) = constant sequences", which stemmed from the fact that for all i, j, a(i) = a(j) => b(i) = b(j) for any sequence b that obtains a constant value for all odd primes A065091. %C A305801 For example, we have for all i, j: %C A305801 a(i) = a(j) => A305800(i) = A305800(j), %C A305801 a(i) = a(j) => A007814(i) = A007814(j), %C A305801 a(i) = a(j) => A305891(i) = A305891(j) => A291761(i) = A291761(j). %C A305801 There are several filter sequences "above" this one (meaning that they have finer equivalence class partitioning), for example, we have, for all i, j: %C A305801 [where odd primes are further distinguished by] %C A305801 A305900(i) = A305900(j) => a(i) = a(j), [whether p = 3 or > 3] %C A305801 A319350(i) = A319350(j) => a(i) = a(j), [A007733(p)] %C A305801 A319704(i) = A319704(j) => a(i) = a(j), [p mod 4] %C A305801 A319705(i) = A319705(j) => a(i) = a(j), [A286622(p)] %C A305801 A331304(i) = A331304(j) => a(i) = a(j), [parity of A000720(p)] %C A305801 A336855(i) = A336855(j) => a(i) = a(j). [distance to the next larger prime] %H A305801 Antti Karttunen, <a href="/A305801/b305801.txt">Table of n, a(n) for n = 1..100000</a> %F A305801 a(1) = 1, a(2) = 2; for n > 2, a(n) = 3 for odd primes, and a(n) = 2+n-A000720(n) for composite n. %F A305801 For n > 2, a(n) = 1 + A305800(n). %t A305801 Array[If[# <= 2, #, If[PrimeQ[#], 3, 2 + # - PrimePi[#]]] &, 105] (* _Michael De Vlieger_, Oct 18 2021 *) %o A305801 (PARI) A305801(n) = if(n<=2,n,if(isprime(n),3,2+n-primepi(n))); %Y A305801 Cf. A000720, A065091, A305800, A305900. %Y A305801 Cf. A305900, A319350, A319704, A319705, A331304, A336855 (sequences with finer equivalence class partitioning). %Y A305801 Cf. A305800, A305890, A305891, A305896, A318500, A318888, A319346, A319347, A319349, A319701, A322591, A322809, A322810, A323078, A323367, A323082, A323369, A323370, A323371, A323374, A323400, A324401, A326199, A326201, A326203, A326203, A328470, A329608, A331174, A331730, A331301 (sequences with coarser equivalence class partitioning). %Y A305801 Cf. also A003602, A103391, A295300, A305795, A324400, A331300, A336460 (for similar constructions or similarly useful sequences). %K A305801 nonn %O A305801 1,2 %A A305801 _Antti Karttunen_, Jun 14 2018 %E A305801 Name changed and Comment section rewritten by _Antti Karttunen_, Oct 17 2021