[go: up one dir, main page]

login
Filter sequence for a(prime) = constant sequences.
62

%I #30 Jul 12 2019 14:07:10

%S 1,2,2,3,2,4,2,5,6,7,2,8,2,9,10,11,2,12,2,13,14,15,2,16,17,18,19,20,2,

%T 21,2,22,23,24,25,26,2,27,28,29,2,30,2,31,32,33,2,34,35,36,37,38,2,39,

%U 40,41,42,43,2,44,2,45,46,47,48,49,2,50,51,52,2,53,2,54,55,56,57,58,2,59,60,61,2,62,63,64,65,66,2,67,68,69,70,71,72,73,2,74,75,76,2,77,2,78,79,80,2,81,2,82,83,84,2,85,86,87,88,89,90,91,92,93,94,95,96

%N Filter sequence for a(prime) = constant sequences.

%C Restricted growth sequence transform of A239968.

%C In the following, A stands for this sequence, A305800, and S -> T (where S and T are sequence A-numbers) indicates that for all i, j: S(i) = S(i) => T(i) = T(j).

%C For example, the following implications hold:

%C A -> A300247 -> A305897 -> A077462 -> A101296,

%C A -> A290110 -> A300250 -> A101296.

%H Antti Karttunen, <a href="/A305800/b305800.txt">Table of n, a(n) for n = 1..100000</a>

%F a(1) = 1; for n > 1, a(n) = 2 for prime n, and a(n) = 1+n-A000720(n) for composite n.

%t Join[{1},Table[If[PrimeQ[n],2,1+n-PrimePi[n]],{n,2,150}]] (* _Harvey P. Dale_, Jul 12 2019 *)

%o (PARI) A305800(n) = if(1==n,n,if(isprime(n),2,1+n-primepi(n)));

%Y Cf. A000720, A239968.

%Y Differs from A296073 for the first time at n=125, as a(125) = 96, while A296073(125) = 33.

%Y Cf. also A305900, A305801, A295300, A289626 for other "upper level" filters.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jun 14 2018