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.

A322273 Smallest multiplication factors f, prime or 1, for all b (mod 840), coprime to 840 (= 4*7#), so that b*f is a nonzero square mod 8, mod 3, mod 5, and mod 7.

This page as a plain text file.
%I A322273 #30 Sep 11 2022 12:06:38
%S A322273 1,11,13,17,19,23,29,31,37,41,43,47,53,59,61,43,71,73,79,83,41,73,101,
%T A322273 103,107,109,113,1,127,59,113,19,47,29,79,13,43,47,1,173,11,61,283,71,
%U A322273 193,53,31,41,211,29,103,83,61,113,71,241,127,59,37,17,23
%N A322273 Smallest multiplication factors f, prime or 1, for all b (mod 840), coprime to 840 (= 4*7#), so that b*f is a nonzero square mod 8, mod 3, mod 5, and mod 7.
%C A322273 See sequence A322269 for further explanations. This sequence is related to A322269(4).
%C A322273 The sequence is periodic, repeating itself after phi(840) = 192 terms. Its largest term is 311, which is A322269(4). In order to satisfy the conditions, both f and b must be coprime to 840. Otherwise, the product would be zero mod a prime <= 7.
%C A322273 The b(n) corresponding to each a(n) is A008364(n).
%C A322273 The first 15 terms are trivial: f=b, and then the product b*f naturally is a square modulo everything.
%H A322273 Hans Ruegg, <a href="/A322273/b322273.txt">Table of n, a(n) for n = 1..192</a>
%e A322273 The 16th number coprime to 840 is 67. a(16) is 43, because 43 is the smallest prime by which we can multiply 67, so that the product (67*43 = 2881) is a square mod 8, mod 2, mod 3, mod 5, and mod 7.
%o A322273 (PARI)
%o A322273 QresCode(n, nPrimes) = {
%o A322273   code = bitand(n,7)>>1;
%o A322273   for (j=2, nPrimes,
%o A322273     x = Mod(n,prime(j));
%o A322273     if (issquare(x), code += (1<<j));
%o A322273   );
%o A322273   return (code);
%o A322273 }
%o A322273 QCodeArray(n) = {
%o A322273   totalEntries = 1<<(n+1);
%o A322273   f = vector(totalEntries);
%o A322273   f[totalEntries-3] = 1;  \\ 1 always has the same code: ...111100
%o A322273   counter = 1;
%o A322273   forprime(p=prime(n+1), +oo,
%o A322273     code = QresCode(p, n);
%o A322273     if (f[code+1]==0,
%o A322273       f[code+1]=p;
%o A322273       counter += 1;
%o A322273       if (counter==totalEntries, return(f));
%o A322273     )
%o A322273   )
%o A322273 }
%o A322273 sequence(n) = {
%o A322273   f = QCodeArray(n);
%o A322273   primorial = prod(i=1, n, prime(i));
%o A322273   entries = eulerphi(4*primorial);
%o A322273   a = vector(entries);
%o A322273   i = 1;
%o A322273   forstep (x=1, 4*primorial-1, 2,
%o A322273     if (gcd(x,primorial)==1,
%o A322273       a[i] = f[QresCode(x, n)+1];
%o A322273       i += 1;
%o A322273     );
%o A322273   );
%o A322273   return(a);
%o A322273 }
%o A322273 \\ sequence(4) returns this sequence.
%o A322273 \\ sequence(2) returns A322271, sequence(3) returns A322272, ... sequence(6) returns A322275.
%Y A322273 Cf. A322269, A322271, A322272, A322274, A322275, A008364.
%K A322273 nonn,fini,full
%O A322273 1,2
%A A322273 _Hans Ruegg_, Dec 01 2018