Skip to main content
added 70 characters in body
Source Link
L. F.
  • 221
  • 4
  • 10

Rust, 7272 70 bytes

  
|n,r|(0..=nn).any(|i|(|p|format|i|format!("{}{}",p,p*p)==nr.to_stringpow()i)(,r.pow(i2*i))==n.to_string())

Try it online!Try it online!

A port of ovs's 05AB1E answer. Thanks to ovs for helping save 2 bytes!

Rust, 72 bytes

 
|n,r|(0..=n).any(|i|(|p|format!("{}{}",p,p*p)==n.to_string())(r.pow(i)))

Try it online!

A port of ovs's 05AB1E answer.

Rust, 72 70 bytes

 
|n,r|(0..n).any(|i|format!("{}{}",r.pow(i),r.pow(2*i))==n.to_string())

Try it online!

A port of ovs's 05AB1E answer. Thanks to ovs for helping save 2 bytes!

Source Link
L. F.
  • 221
  • 4
  • 10

Rust, 72 bytes

|n,r|(0..=n).any(|i|(|p|format!("{}{}",p,p*p)==n.to_string())(r.pow(i)))

Try it online!

A port of ovs's 05AB1E answer.