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-2 of 2 results.

A114874 Numbers representable in exactly two ways as (p-1)*p^e (where p is a prime and e >= 0) in ascending order.

Original entry on oeis.org

2, 4, 6, 16, 18, 42, 100, 156, 162, 256, 486, 1458, 2028, 4422, 6162, 14406, 19182, 22650, 23548, 26406, 37056, 39366, 62500, 65536, 77658, 113232, 121452, 143262, 208392, 292140, 342732, 375156, 412806, 527802, 564898, 590592, 697048, 843642
Offset: 1

Views

Author

Franz Vrabec, Jan 03 2006

Keywords

Comments

Numbers that are one less than a prime number and of the form (p-1)*p^e for some prime p and e > 0. - Jianing Song, Apr 13 2019

Examples

			6 is a member because 6 = (3-1)*3^1 = (7-1)*7^0 and 3 and 7 are primes.
		

Crossrefs

Programs

  • Mathematica
    s = Split@Sort@Flatten@Table[(Prime[n] - 1)Prime[n]^k, {n, 68000}, {k, 0, 16}]; Union@Flatten@Select[s, Length@# == 2 &] (* Robert G. Wilson v, Jan 05 2006 *)
  • PARI
    isA114874(n) = if(n>1, my(v=factor(n), d=#v[, 1], p=v[d,1], e=v[d,2]); (isprime(n+1) && n==(p-1)*p^e), 0) \\ Jianing Song, Apr 13 2019

Extensions

a(13)-a(38) from Robert G. Wilson v, Jan 05 2006

A134269 Number of solutions to the equation p^k - p^(k-1) = n, where k is a positive integer and p is prime.

Original entry on oeis.org

1, 2, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Anthony C Robin, Jan 15 2008

Keywords

Comments

The Euler phi function A000010 (number of integers less than n which are coprime with n) involves calculating the expression p^(k-1)*(p-1), where p is prime. For example phi(120) = phi(2^3*3*5) = (2^3-2^2)*(3-1)*(5-1) = 4*2*4 = 32.

Examples

			Notice that it is not possible to have more than 2 solutions, but say when n=4 there are two solutions, namely 5^1 - 5^0 and 2^3 - 2^2.
a(2) = 2 refers to 2^2 - 2^1 = 2 and 3^1 - 3^0 = 2.
a(6) = 2 as 6 = 3^2 - 3^1 = 7^1 - 7^0.
		

Crossrefs

Programs

  • Maple
    A134269 := proc(n)
        local a,p,r ;
        a := 0 ;
        p :=2 ;
        while p <= n+1 do
            r := n/(p-1) ;
            if type(r,'integer') then
                if r = 1 then
                    a := a+1 ;
                else
                    r := ifactors(r)[2] ;
                    if nops(r) = 1 then
                        if op(1,op(1,r)) = p then
                            a := a+1 ;
                        end if;
                    end if;
                end if;
            end if;
            p := nextprime(p) ;
        end do:
        return a;
    end proc: # R. J. Mathar, Aug 06 2013
  • PARI
    lista(N=100) = {tab = vector(N); for (i=1, N, p = prime(i); for (j=1, N, v = p^j-p^(j-1); if (v <= #tab, tab[v]++););); for (i=1, #tab, print1(tab[i], ", "));} \\ Michel Marcus, Aug 06 2013
    
  • PARI
    A134269list(up_to) = { my(v=vector(up_to)); forprime(p=2,1+up_to, for(j=1,oo,my(d = (p^j)-(p^(j-1))); if(d>up_to,break,v[d]++))); (v); };
    v134269 = A134269list(up_to);
    A134269(n) = v134269[n]; \\ Antti Karttunen, Nov 09 2018

Extensions

a(2) corrected by Michel Marcus, Aug 06 2013
More terms from Antti Karttunen, Nov 09 2018
Showing 1-2 of 2 results.