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.

Showing 1-3 of 3 results.

A061898 Swap each prime in factorization of n with "neighbor" prime.

Original entry on oeis.org

1, 3, 2, 9, 7, 6, 5, 27, 4, 21, 13, 18, 11, 15, 14, 81, 19, 12, 17, 63, 10, 39, 29, 54, 49, 33, 8, 45, 23, 42, 37, 243, 26, 57, 35, 36, 31, 51, 22, 189, 43, 30, 41, 117, 28, 87, 53, 162, 25, 147, 38, 99, 47, 24, 91, 135, 34, 69, 61, 126, 59, 111, 20, 729, 77, 78, 71, 171, 58
Offset: 1

Views

Author

Marc LeBrun, May 14 2001

Keywords

Comments

Here "neighbor" primes are just paired in order: 2<->3, 5<->7, 11<->13, etc. Self-inverse permutation of the integers. Multiplicative.

Examples

			a(60) = 126 since 60 = 2^2*3*5, swapping 2<->3 and 5<->7 gives 3^2*2*7 = 126 (and of course then a(126) = 60).
		

Crossrefs

Cf. A045965, A275407 (fixed points).

Programs

  • Maple
    p:= proc(n) option remember; `if`(numtheory[pi](n)::odd,
           nextprime(n), prevprime(n))
        end:
    a:= n-> mul(p(i[1])^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Sep 13 2017
  • Mathematica
    p[n_] := p[n] = If[OddQ[PrimePi[n]], NextPrime[n], NextPrime[n, -1]];
    a[1] = 1; a[n_] := Product[p[i[[1]]]^i[[2]], {i, FactorInteger[n]}];
    Array[a, 80] (* Jean-François Alcover, Jun 10 2018, after Alois P. Heinz *)
  • PARI
    a(n) = my(f=factor(n)); for (i=1, #f~, ip = primepi(f[i,1]); if (ip % 2, f[i,1] = prime(ip+1), f[i,1] = prime(ip-1))); factorback(f); \\ Michel Marcus, Jun 09 2014

Formula

Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (p^2-p)/(p^2-q(p)) = 0.9229142333..., where q(p) is the "neighbor" of p. - Amiram Eldar, Nov 29 2022

A275474 Numbers n for which e_n(2*i)=e_n(2*i+1), for all i>=1, where e_n(k)>=0 denote the exponent of prime(k) in the prime power representation of n.

Original entry on oeis.org

1, 2, 4, 8, 15, 16, 30, 32, 60, 64, 77, 120, 128, 154, 221, 225, 240, 256, 308, 437, 442, 450, 480, 512, 616, 874, 884, 899, 900, 960, 1024, 1155, 1232, 1517, 1748, 1768, 1798, 1800, 1920, 2021, 2048, 2310, 2464, 3034, 3127, 3315, 3375, 3496, 3536, 3596, 3600
Offset: 1

Views

Author

Vladimir Shevelev, Jul 29 2016

Keywords

Comments

There exists a permutation alpha of the sequence such that {alpha(a(n))} is a completely multiplicative function.
Numbers which are the product of zero or more of {2, 3*5, 7*11, 13*17, 19*23, ...} with multiplicity. - Charles R Greathouse IV, Jul 30 2016

Examples

			1 is a member, since all e_1(k)=0;
Powers 2^m, m>=1, are members, since e_2^m(k)=0, for all k>=2;
15 is a member, since e_15(2)*e_15(3)=1;
n = 2983500 is a member, since e_n(1)=2, e_n(2)=e_n(3)=3 and e_n(6)=e_n(7)=1, all other e_n(k)=0.
		

Crossrefs

Programs

  • PARI
    is(n)=my(f=factor(n>>valuation(n,2))); if (#f~%2, return(0)); for(i=1,#f~/2, if(f[2*i-1,2]!=f[2*i,2] || nextprime(f[2*i-1,1]+1)!=f[2*i,1], return(0))); for(i=1,#f~/2, if(primepi(f[2*i,1])%2==0, return(0))); 1 \\ Charles R Greathouse IV, Jul 30 2016
    
  • PARI
    list(lim)=my(v=List([1,2]),p=3,pStart=2,pEnd,start=2,end,nStart,t); lim\=1; forprime(q=5,sqrtint(lim+1)+1, p=if(p, listput(v,p*q); 0, q)); end=pEnd=#v; for(n=2,logint(lim,2), nStart=end+1; for(i=start,end, for(j=pStart,pEnd, t=v[i]*v[j]; if(t>lim, break); listput(v, t))); start=nStart; end=#v); Set(v) \\ Charles R Greathouse IV, Jul 30 2016

Extensions

More terms from Peter J. C. Moses, Jul 29 2016

A319523 Square array T(n, k) (n >= 1, k >= 1) read by antidiagonals upwards: T(n, k) is the unique positive integer m such that A319521(m) = n and A319522(m) = k.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 4, 15, 14, 9, 11, 12, 35, 18, 13, 10, 33, 28, 45, 26, 21, 17, 30, 77, 36, 65, 42, 19, 8, 51, 70, 99, 52, 105, 38, 27, 25, 24, 119, 90, 143, 84, 95, 54, 49, 22, 75, 56, 153, 130, 231, 76, 135, 98, 39, 23, 66, 175, 72, 221, 210, 209, 108, 245
Offset: 1

Views

Author

Rémy Sigrist, Sep 22 2018

Keywords

Examples

			Array T(n, k) begins:
  n\k|    1    2    3    4    5    6    7    8    9   10   11   12
  ---+------------------------------------------------------------
    1|    1    3    7    9   13   21   19   27   49   39   29   63
    2|    2    6   14   18   26   42   38   54   98   78   58  126
    3|    5   15   35   45   65  105   95  135  245  195  145  315
    4|    4   12   28   36   52   84   76  108  196  156  116  252
    5|   11   33   77   99  143  231  209  297  539  429  319  693
    6|   10   30   70   90  130  210  190  270  490  390  290  630
    7|   17   51  119  153  221  357  323  459  833  663  493 1071
    8|    8   24   56   72  104  168  152  216  392  312  232  504
    9|   25   75  175  225  325  525  475  675 1225  975  725 1575
   10|   22   66  154  198  286  462  418  594 1078  858  638 1386
		

Crossrefs

Cf. A001221, A001222, A061898, A275407 (main diagonal), A297002 (first row), A319521, A319522, A319525 (first column).

Programs

  • PARI
    T(n,k) = my (fn=factor(n), fk=factor(k)); prod(i=1, #fn~, prime(2*primepi(fn[i,1])-1)^fn[i,2]) * prod(i=1, #fk~, prime(2*primepi(fk[i,1]))^fk[i,2])

Formula

T(n, k) = A061898(T(k, n)).
T(n, n) = A275407(n).
T(n, 1) = A319525(n).
T(1, k) = A297002(k).
T(n, k) = T(n, 1) * T(1, k) = A319525(n) * A297002(k).
A001221(T(n, k)) = A001221(n) + A001221(k).
A001222(T(n, k)) = A001222(n) + A001222(k).
Showing 1-3 of 3 results.