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.

A365512 a(n) is the least odd prime p such that A000120(n*p) = A000120(n) * A000120(p).

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 17, 3, 3, 3, 17, 5, 17, 17, 17, 3, 3, 3, 5, 3, 3, 17, 257, 5, 5, 17, 257, 17, 257, 17, 257, 3, 3, 3, 5, 3, 3, 5, 257, 3, 3, 3, 257, 17, 17, 257, 257, 5, 5, 5, 5, 17, 257, 257, 257, 17, 257, 257, 257, 17, 257, 257, 257, 3, 3, 3, 5, 3, 3, 5, 257, 3, 3, 3, 17, 5, 257, 257, 257, 3
Offset: 1

Views

Author

Robert Israel, Sep 07 2023

Keywords

Comments

a(2*n) = a(n).
a(n) <= A365475(A070939(n)), with a(2^n-1) = A365475(n).

Examples

			a(3) = 5 because 5 is an odd prime with A000120(3 * 5) = 4 = A000120(3) * A000120(5) while A000120(3 * 3) = 2 < 4 = A000120(3) * A000120(3).
		

Crossrefs

Programs

  • Maple
    g:= n -> convert(convert(n,base,2),`+`):
    f:= proc(n) option remember; local t,S,d,L,B,forbid,i,j,r,q;
      if n::even then return procname(n/2^padic:-ordp(n,2)) fi;
      L:= convert(n,base,2);
      t:= convert(L,`+`);
      B:= select(t -> L[t]=1, [$1..nops(L)]);
      forbid:= {seq(seq(B[i]-B[j],j=1..i-1),i=1..nops(B))};
      S[0]:= [1];
      for d from 1 do
        S[d]:= NULL;
        for j from 0 to d-1 do
          if member(d-j,forbid) then next fi;
          for r in S[j] do
            q:= r + 2^d;
            if g(q*n) = t*g(q) then
              if isprime(q) then return q fi;
              S[d]:= S[d], q;
            fi
          od
        od;
        S[d]:= [S[d]];
      od
    end proc:
    map(f, [$1..100]);
  • PARI
    a(n) = my(p=3, h=hammingweight(n)); while (hammingweight(n*p) != h*hammingweight(p), p = nextprime(p+1)); p; \\ Michel Marcus, Sep 08 2023