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.

A225100 First occurrence of n in A225099, or -1 if n does not appear in A225099.

Original entry on oeis.org

0, 12, 36, 370, 3770, 12410, 202130, 197210, 81770, 9151610, 16046810, 12625730, 21899930, 95336930, 9549410, 416392730, 1016275130, 338609570, 789396530, 601741010, 254885930, 10083683090, 4690939370, 29207671610, 30431277890, 22264417370, 23231920010, 10838858810, 37462976330
Offset: 0

Views

Author

Alex Ratushnyak, Apr 27 2013

Keywords

Comments

Least integer k representable as a sum of two distinct nontrivial prime powers (A025475 except the first term) in exactly n ways.

Crossrefs

Cf. A225099.

Programs

  • C
    #include 
    #include 
    #define TOP (5ULL<<16)
    typedef unsigned long long U64;
    U64 *mem, pwFlat[TOP], primes[TOP]={2}, f[96];
    int pp_compare(const void *p1, const void *p2) {
      if (*(U64*)p1 == *(U64*)p2) return 0;
      if (*(U64*)p1 < *(U64*)p2) return -1;
      return 1;
    }
    int main() {
      U64 i, j, k, p, pp=1, pfp;
      mem = (U64*)malloc(3ULL<<30);
      for (i = 3; i < TOP; i+=2) {
        for (p = 0; p < pp; ++p)  if (i%primes[p] == 0) break;
        if (p==pp)  primes[pp++] = i;
      }
      for (pfp = i = 0; i < pp; ++i)
        for (j = primes[i]*primes[i]; j < TOP*TOP; j *= primes[i])
          pwFlat[pfp++] = j;
      for (k = i = 0; i < pfp; ++i)
        for (j = i+1; j < pfp; ++j)
          if ((p = pwFlat[i] + pwFlat[j]) < TOP*TOP) mem[k++] = p;
      qsort(mem, k, 8, pp_compare);
      p = mem[0];
      for (i = j = mem[k] = 1; i <= k; ++i) {
        if (p == mem[i])  { ++j; continue; }
        if (j < 96 && f[j] == 0)  f[j] = p;
        p = mem[i];
        j = 1;
      }
      for (i = 0; i < 96; ++i)  printf("%llu, ", f[i]);
      return 0;
    }
  • Mathematica
    nn = 300000; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; t =Sort[Select[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]], # <= nn &]]; t2 = Table[Count[t, n], {n, 0, nn}]; n2 = Max[t2]; Table[Position[t2, n, 1, 1][[1, 1]], {n, 0, n2}] - 1(* T. D. Noe, Apr 29 2013 *)