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.

A319704 Filter sequence which records for primes their residue modulo 4, and for all other numbers assigns a unique number.

This page as a plain text file.
%I A319704 #10 Sep 26 2018 16:24:18
%S A319704 1,2,3,4,5,6,3,7,8,9,3,10,5,11,12,13,5,14,3,15,16,17,3,18,19,20,21,22,
%T A319704 5,23,3,24,25,26,27,28,5,29,30,31,5,32,3,33,34,35,3,36,37,38,39,40,5,
%U A319704 41,42,43,44,45,3,46,5,47,48,49,50,51,3,52,53,54,3,55,5,56,57,58,59,60,3,61,62,63,3,64,65,66,67,68,5,69,70,71,72,73,74,75,5,76,77,78,5,79,3
%N A319704 Filter sequence which records for primes their residue modulo 4, and for all other numbers assigns a unique number.
%C A319704 Restricted growth sequence transform of function f defined as f(n) = A010873(n) when n is a prime, otherwise -n.
%C A319704 For all i, j:
%C A319704   a(i) = a(j) => A010873(i) = A010873(j),
%C A319704   a(i) = a(j) => A305801(i) = A305801(j),
%C A319704   a(i) = a(j) => A319714(i) = A319714(j).
%H A319704 Antti Karttunen, <a href="/A319704/b319704.txt">Table of n, a(n) for n = 1..100000</a>
%o A319704 (PARI)
%o A319704 up_to = 100000;
%o A319704 rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
%o A319704 A319704aux(n) = if(isprime(n),-(n%4),n);
%o A319704 v319704 = rgs_transform(vector(up_to,n,A319704aux(n)));
%o A319704 A319704(n) = v319704[n];
%Y A319704 Cf. A010873, A305801, A319714.
%Y A319704 Cf. A002145 (positions of 3's), A002144 (positions of 5's).
%Y A319704 Cf. also A319350, A319705, A319706.
%K A319704 nonn
%O A319704 1,2
%A A319704 _Antti Karttunen_, Sep 26 2018