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.

A322973 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(1) = 0, f(n) = -1 if n is an odd prime, and f(n) = A006370(n) for all other numbers.

This page as a plain text file.
%I A322973 #14 Feb 09 2019 23:28:07
%S A322973 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 A322973 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 A322973 40,41,7,42,43,3,44,3,45,46,47,48,49,3,50,51,52,3,53,3,54,55,56,57,58,3,59,60,61,3,62,63,64,65,66,3,67,68,11,69,70,71,72,3,73,74,75,3,76,3
%N A322973 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(1) = 0, f(n) = -1 if n is an odd prime, and f(n) = A006370(n) for all other numbers.
%C A322973 For all i, j: a(i) = a(j) => A274472(i) = A274472(j).
%H A322973 Antti Karttunen, <a href="/A322973/b322973.txt">Table of n, a(n) for n = 1..65537</a>
%H A322973 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%o A322973 (PARI)
%o A322973 up_to = 65537;
%o A322973 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 A322973 A006370(n) = if(n%2, 3*n+1, n/2);
%o A322973 A322973aux(n) = if(1==n,0,if((n>2)&&isprime(n),-1,A006370(n)));
%o A322973 v322973 = rgs_transform(vector(up_to,n,A322973aux(n)));
%o A322973 A322973(n) = v322973[n];
%Y A322973 Cf. A006370, A274472, A305801.
%Y A322973 See the crossrefs section in A322809 for a list of similarly constructed filter sequences.
%K A322973 nonn
%O A322973 1,2
%A A322973 _Antti Karttunen_, Jan 05 2019