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.

A126254 Number of distinct terms i^j for 1 <= i,j <= n.

This page as a plain text file.
%I A126254 #27 Feb 11 2024 17:11:10
%S A126254 1,3,7,11,19,28,40,50,60,76,96,115,139,163,189,207,239,270,306,340,
%T A126254 378,417,461,503,539,585,621,670,726,779,839,881,941,1003,1067,1113,
%U A126254 1185,1254,1326,1397,1477,1553,1637,1717,1799,1884,1976,2063,2135,2225
%N A126254 Number of distinct terms i^j for 1 <= i,j <= n.
%C A126254 An easy upper bound is n(n-1)+1 = A002061(n).
%H A126254 Nick Hobson and John Silberholz, <a href="/A126254/b126254.txt">Table of n, a(n) for n = 1..10000</a> [Terms 1 through 1000 were computed by N. Hobson; terms 1001 through 10000 by John Silberholz, Feb 23 2015]
%H A126254 John Silberholz, <a href="http://stackoverflow.com/a/28676964/3093387">Combinatorial approach to calculate sequence</a>
%e A126254 a(4) = 11, as there are 11 distinct terms in 1^1=1, 1^2=1, 1^3=1, 1^4=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 3^1=3, 3^2=9, 3^3=27, 3^4=81, 4^1=4, 4^2=16, 4^3=64, 4^4=256.
%p A126254 seq(nops({seq(seq(i^j, i=1..n),j=1..n)}),n=1..100); # _Robert Israel_, Feb 23 2015
%o A126254 (PARI) lim=50; z=listcreate(lim*(lim-1)+1); for(m=1, lim, for(i=1, m, x=factor(i); x[, 2]*=m; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); t=factor(m); for(j=1, m, x=t; x[, 2]=j*t[, 2]; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(#z, ", "))
%o A126254 (R) A126254 <- function(limit) {  if (limit == 1) { return(1) } ; num.powers <- c(1, rep(0, limit-1)) ; handled <- c(T, rep(F, limit-1)) ; for (base in 2:ceiling(sqrt(limit))) { if (!handled[base]) { num.handle <- floor(log(limit, base)) ; handled[base^(1:num.handle)] <- T ; num.powers[base] <- length(unique(as.vector(outer(1:num.handle, 1:limit)))) }} ; num.powers[!handled] <- limit ; sum(num.powers) } ; A126254(50) # _John Silberholz_, Feb 23 2015
%o A126254 (Python)
%o A126254 def A126254(n): return len({i**j for i in range(1,n+1) for j in range(1,n+1)}) # _Chai Wah Wu_, Oct 17 2023
%Y A126254 Cf. A027424, A061786, A126255, A126256, A126257.
%K A126254 easy,nonn
%O A126254 1,2
%A A126254 _Nick Hobson_, Dec 24 2006